Beispiel #1
0
TEST(gnc_timezone_constructors, test_posix_timezone)
{
    std::string timezone("FST08FDT07,M4.1.0,M10.31.0");
    TimeZoneProvider tzp(timezone);
    TZ_Ptr tz = tzp.get(2006);
    EXPECT_TRUE(tz->std_zone_abbrev() == "FST");
    EXPECT_TRUE(tz->dst_zone_abbrev() == "FDT");
    EXPECT_TRUE(tz->base_utc_offset().hours() == 8L);
    EXPECT_TRUE(tz->dst_offset().hours() == 7L);
}
Beispiel #2
0
TEST(gnc_timezone_constructors, test_pacific_time_constructor)
{
#if PLATFORM(WINDOWS)
    std::string timzone("Pacific Standard Time");
#else
    std::string timezone("America/Los_Angeles");
#endif
    TimeZoneProvider tzp (timezone);
    EXPECT_NO_THROW (tzp.get(2006));
    TZ_Ptr tz = tzp.get (2006);

    EXPECT_FALSE(tz->std_zone_abbrev().empty());
#if PLATFORM(WINDOWS)
    EXPECT_TRUE(tz->std_zone_abbrev() == timezone);
#else
    EXPECT_TRUE(tz->std_zone_abbrev() == "PST");
    EXPECT_TRUE(tz->dst_zone_abbrev() == "PDT");
#endif
    EXPECT_TRUE(tz->base_utc_offset().hours() == -8);
}