]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/test/intltest/tztest.cpp
ICU-64232.0.1.tar.gz
[apple/icu.git] / icuSources / test / intltest / tztest.cpp
index 31a34c64198ac9b67fcb5c5d2240600fd768e6b8..c531395871041a026e62263a37ae7b1242cefe84 100644 (file)
@@ -72,6 +72,7 @@ void TimeZoneTest::runIndexedTest( int32_t index, UBool exec, const char* &name,
     TESTCASE_AUTO(TestGetRegion);
     TESTCASE_AUTO(TestGetAvailableIDsNew);
     TESTCASE_AUTO(TestGetUnknown);
+    TESTCASE_AUTO(TestGetGMT);
     TESTCASE_AUTO(TestGetWindowsID);
     TESTCASE_AUTO(TestGetIDForWindowsID);
     TESTCASE_AUTO_END;
@@ -2420,6 +2421,15 @@ void TimeZoneTest::TestGetUnknown() {
     assertFalse("getUnknown() uses DST", unknown.useDaylightTime());
 }
 
+void TimeZoneTest::TestGetGMT() {
+    const TimeZone *gmt = TimeZone::getGMT();
+    UnicodeString expectedID = UNICODE_STRING_SIMPLE("GMT");
+    UnicodeString id;
+    assertEquals("getGMT() wrong ID", expectedID, gmt->getID(id));
+    assertTrue("getGMT() wrong offset", 0 == gmt->getRawOffset());
+    assertFalse("getGMT() uses DST", gmt->useDaylightTime());
+}
+
 void TimeZoneTest::TestGetWindowsID(void) {
     static const struct {
         const char *id;