mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Add tests for GMT and GMT+7 timezones.
This commit is contained in:
parent
5af21dfad8
commit
baad2097a7
@ -67,10 +67,35 @@ TEST(gnc_timezone_constructors, test_posix_timezone)
|
||||
TZ_Ptr tz = tzp.get(2006);
|
||||
EXPECT_EQ(tz->std_zone_abbrev(), "FST");
|
||||
EXPECT_EQ(tz->dst_zone_abbrev(), "FDT");
|
||||
EXPECT_TRUE(tz->has_dst());
|
||||
EXPECT_EQ(tz->base_utc_offset().hours(), 8L);
|
||||
EXPECT_EQ(tz->dst_offset().hours(), 7L);
|
||||
}
|
||||
|
||||
TEST(gnc_timezone_constructors, test_gmt_timezone)
|
||||
{
|
||||
std::string timezone("GMT");
|
||||
TimeZoneProvider tzp(timezone);
|
||||
TZ_Ptr tz = tzp.get(2006);
|
||||
EXPECT_EQ(tz->std_zone_abbrev(), "GMT");
|
||||
EXPECT_FALSE(tz->has_dst());
|
||||
EXPECT_EQ(tz->dst_zone_abbrev(), "");
|
||||
EXPECT_EQ(tz->base_utc_offset().hours(), 0L);
|
||||
EXPECT_EQ(tz->dst_offset().hours(), 0L);
|
||||
}
|
||||
|
||||
TEST(gnc_timezone_constructors, test_GMT_plus_7_timezone)
|
||||
{
|
||||
std::string timezone("Etc/GMT+7");
|
||||
TimeZoneProvider tzp(timezone);
|
||||
TZ_Ptr tz = tzp.get(2006);
|
||||
EXPECT_EQ(tz->std_zone_abbrev(), "-07");
|
||||
EXPECT_EQ(tz->dst_zone_abbrev(), "");
|
||||
EXPECT_FALSE(tz->has_dst());
|
||||
EXPECT_EQ(tz->base_utc_offset().hours(), -7);
|
||||
EXPECT_EQ(tz->dst_offset().hours(), 0L);
|
||||
}
|
||||
|
||||
TEST(gnc_timezone_constructors, test_IANA_Belize_tz)
|
||||
{
|
||||
TimeZoneProvider tzp("America/Belize");
|
||||
|
Loading…
Reference in New Issue
Block a user