| OLD | NEW |
| 1 /*********************************************************************** | 1 /*********************************************************************** |
| 2 * COPYRIGHT: | 2 * COPYRIGHT: |
| 3 * Copyright (c) 1997-2013, International Business Machines Corporation | 3 * Copyright (c) 1997-2014, International Business Machines Corporation |
| 4 * and others. All Rights Reserved. | 4 * and others. All Rights Reserved. |
| 5 ***********************************************************************/ | 5 ***********************************************************************/ |
| 6 | 6 |
| 7 #include "unicode/utypes.h" | 7 #include "unicode/utypes.h" |
| 8 | 8 |
| 9 #if !UCONFIG_NO_FORMATTING | 9 #if !UCONFIG_NO_FORMATTING |
| 10 | 10 |
| 11 #include "unicode/timezone.h" | 11 #include "unicode/timezone.h" |
| 12 #include "unicode/simpletz.h" | 12 #include "unicode/simpletz.h" |
| 13 #include "unicode/calendar.h" | 13 #include "unicode/calendar.h" |
| 14 #include "unicode/gregocal.h" | 14 #include "unicode/gregocal.h" |
| 15 #include "unicode/resbund.h" | 15 #include "unicode/resbund.h" |
| 16 #include "unicode/strenum.h" | 16 #include "unicode/strenum.h" |
| 17 #include "unicode/uversion.h" | 17 #include "unicode/uversion.h" |
| 18 #include "tztest.h" | 18 #include "tztest.h" |
| 19 #include "cmemory.h" | 19 #include "cmemory.h" |
| 20 #include "putilimp.h" | 20 #include "putilimp.h" |
| 21 #include "cstring.h" | 21 #include "cstring.h" |
| 22 #include "olsontz.h" | 22 #include "olsontz.h" |
| 23 | 23 |
| 24 #define LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0])) | |
| 25 | |
| 26 #define CASE(id,test) case id: \ | 24 #define CASE(id,test) case id: \ |
| 27 name = #test; \ | 25 name = #test; \ |
| 28 if (exec) { \ | 26 if (exec) { \ |
| 29 logln(#test "---"); logln(""); \ | 27 logln(#test "---"); logln(""); \ |
| 30 test(); \ | 28 test(); \ |
| 31 } \ | 29 } \ |
| 32 break | 30 break |
| 33 | 31 |
| 34 // ***************************************************************************** | 32 // ***************************************************************************** |
| 35 // class TimeZoneTest | 33 // class TimeZoneTest |
| (...skipping 23 matching lines...) Expand all Loading... |
| 59 TESTCASE_AUTO(TestCustomParse); | 57 TESTCASE_AUTO(TestCustomParse); |
| 60 TESTCASE_AUTO(TestDisplayName); | 58 TESTCASE_AUTO(TestDisplayName); |
| 61 TESTCASE_AUTO(TestDSTSavings); | 59 TESTCASE_AUTO(TestDSTSavings); |
| 62 TESTCASE_AUTO(TestAlternateRules); | 60 TESTCASE_AUTO(TestAlternateRules); |
| 63 TESTCASE_AUTO(TestCountries); | 61 TESTCASE_AUTO(TestCountries); |
| 64 TESTCASE_AUTO(TestHistorical); | 62 TESTCASE_AUTO(TestHistorical); |
| 65 TESTCASE_AUTO(TestEquivalentIDs); | 63 TESTCASE_AUTO(TestEquivalentIDs); |
| 66 TESTCASE_AUTO(TestAliasedNames); | 64 TESTCASE_AUTO(TestAliasedNames); |
| 67 TESTCASE_AUTO(TestFractionalDST); | 65 TESTCASE_AUTO(TestFractionalDST); |
| 68 TESTCASE_AUTO(TestFebruary); | 66 TESTCASE_AUTO(TestFebruary); |
| 67 TESTCASE_AUTO(TestCanonicalIDAPI); |
| 69 TESTCASE_AUTO(TestCanonicalID); | 68 TESTCASE_AUTO(TestCanonicalID); |
| 70 TESTCASE_AUTO(TestDisplayNamesMeta); | 69 TESTCASE_AUTO(TestDisplayNamesMeta); |
| 71 TESTCASE_AUTO(TestGetRegion); | 70 TESTCASE_AUTO(TestGetRegion); |
| 72 TESTCASE_AUTO(TestGetAvailableIDsNew); | 71 TESTCASE_AUTO(TestGetAvailableIDsNew); |
| 73 TESTCASE_AUTO(TestGetUnknown); | 72 TESTCASE_AUTO(TestGetUnknown); |
| 74 TESTCASE_AUTO(TestGetWindowsID); | 73 TESTCASE_AUTO(TestGetWindowsID); |
| 75 TESTCASE_AUTO(TestGetIDForWindowsID); | 74 TESTCASE_AUTO(TestGetIDForWindowsID); |
| 76 TESTCASE_AUTO_END; | 75 TESTCASE_AUTO_END; |
| 77 } | 76 } |
| 78 | 77 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 103 zoneclone->setRawOffset(45678); | 102 zoneclone->setRawOffset(45678); |
| 104 if (!(*zoneclone != *zone)) errln("FAIL: clone or operator!= failed"); | 103 if (!(*zoneclone != *zone)) errln("FAIL: clone or operator!= failed"); |
| 105 | 104 |
| 106 SimpleTimeZone copy(*zone); | 105 SimpleTimeZone copy(*zone); |
| 107 if (!(copy == *zone)) errln("FAIL: copy constructor or operator== failed"); | 106 if (!(copy == *zone)) errln("FAIL: copy constructor or operator== failed"); |
| 108 copy = *(SimpleTimeZone*)zoneclone; | 107 copy = *(SimpleTimeZone*)zoneclone; |
| 109 if (!(copy == *zoneclone)) errln("FAIL: assignment operator or operator== fa
iled"); | 108 if (!(copy == *zoneclone)) errln("FAIL: assignment operator or operator== fa
iled"); |
| 110 | 109 |
| 111 TimeZone* saveDefault = TimeZone::createDefault(); | 110 TimeZone* saveDefault = TimeZone::createDefault(); |
| 112 logln((UnicodeString)"TimeZone::createDefault() => " + saveDefault->getID(id
)); | 111 logln((UnicodeString)"TimeZone::createDefault() => " + saveDefault->getID(id
)); |
| 113 TimeZone* pstZone = TimeZone::createTimeZone("America/Los_Angeles"); | 112 |
| 113 TimeZone::adoptDefault(zone); |
| 114 TimeZone* defaultzone = TimeZone::createDefault(); |
| 115 if (defaultzone == zone || |
| 116 !(*defaultzone == *zone)) |
| 117 errln("FAIL: createDefault failed"); |
| 118 TimeZone::adoptDefault(saveDefault); |
| 119 delete defaultzone; |
| 120 delete zoneclone; |
| 114 | 121 |
| 115 logln("call uprv_timezone() which uses the host"); | 122 logln("call uprv_timezone() which uses the host"); |
| 116 logln("to get the difference in seconds between coordinated universal"); | 123 logln("to get the difference in seconds between coordinated universal"); |
| 117 logln("time and local time. E.g., -28,800 for PST (GMT-8hrs)"); | 124 logln("time and local time. E.g., -28,800 for PST (GMT-8hrs)"); |
| 118 | 125 |
| 119 int32_t tzoffset = uprv_timezone(); | 126 int32_t tzoffset = uprv_timezone(); |
| 120 logln(UnicodeString("Value returned from uprv_timezone = ") + tzoffset); | |
| 121 // Invert sign because UNIX semantics are backwards | |
| 122 if (tzoffset < 0) | |
| 123 tzoffset = -tzoffset; | |
| 124 if ((*saveDefault == *pstZone) && (tzoffset != 28800)) { | |
| 125 errln("FAIL: t_timezone may be incorrect. It is not 28800"); | |
| 126 } | |
| 127 | |
| 128 if ((tzoffset % 900) != 0) { | 127 if ((tzoffset % 900) != 0) { |
| 129 /* | 128 /* |
| 130 * Ticket#6364 and #7648 | 129 * Ticket#6364 and #7648 |
| 131 * A few time zones are using GMT offests not a multiple of 15 minutes. | 130 * A few time zones are using GMT offests not a multiple of 15 minutes. |
| 132 * Therefore, we should not interpret such case as an error. | 131 * Therefore, we should not interpret such case as an error. |
| 133 * We downgrade this from errln to infoln. When we see this message, | 132 * We downgrade this from errln to infoln. When we see this message, |
| 134 * we should examine if it is ignorable or not. | 133 * we should examine if it is ignorable or not. |
| 135 */ | 134 */ |
| 136 infoln("WARNING: t_timezone may be incorrect. It is not a multiple of 15
min.", tzoffset); | 135 infoln("WARNING: t_timezone may be incorrect. It is not a multiple of 15
min.", tzoffset); |
| 137 } | 136 } |
| 138 | 137 |
| 139 TimeZone::adoptDefault(zone); | |
| 140 TimeZone* defaultzone = TimeZone::createDefault(); | |
| 141 if (defaultzone == zone || | |
| 142 !(*defaultzone == *zone)) | |
| 143 errln("FAIL: createDefault failed"); | |
| 144 TimeZone::adoptDefault(saveDefault); | |
| 145 delete defaultzone; | |
| 146 delete zoneclone; | |
| 147 delete pstZone; | |
| 148 | |
| 149 UErrorCode status = U_ZERO_ERROR; | 138 UErrorCode status = U_ZERO_ERROR; |
| 150 const char* tzver = TimeZone::getTZDataVersion(status); | 139 const char* tzver = TimeZone::getTZDataVersion(status); |
| 151 if (U_FAILURE(status)) { | 140 if (U_FAILURE(status)) { |
| 152 errcheckln(status, "FAIL: getTZDataVersion failed - %s", u_errorName(sta
tus)); | 141 errcheckln(status, "FAIL: getTZDataVersion failed - %s", u_errorName(sta
tus)); |
| 153 } else if (uprv_strlen(tzver) != 5 /* 4 digits + 1 letter */) { | 142 } else if (uprv_strlen(tzver) != 5 /* 4 digits + 1 letter */) { |
| 154 errln((UnicodeString)"FAIL: getTZDataVersion returned " + tzver); | 143 errln((UnicodeString)"FAIL: getTZDataVersion returned " + tzver); |
| 155 } else { | 144 } else { |
| 156 logln((UnicodeString)"tzdata version: " + tzver); | 145 logln((UnicodeString)"tzdata version: " + tzver); |
| 157 } | 146 } |
| 158 } | 147 } |
| (...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 857 {"IET", -300, TRUE}, // ICU Link - America/Indiana/Indianapolis | 846 {"IET", -300, TRUE}, // ICU Link - America/Indiana/Indianapolis |
| 858 {"EST", -300, FALSE}, // Olson northamerica -5:00 | 847 {"EST", -300, FALSE}, // Olson northamerica -5:00 |
| 859 {"PRT", -240, FALSE}, // ICU Link - America/Puerto_Rico | 848 {"PRT", -240, FALSE}, // ICU Link - America/Puerto_Rico |
| 860 {"CNT", -210, TRUE}, // ICU Link - America/St_Johns | 849 {"CNT", -210, TRUE}, // ICU Link - America/St_Johns |
| 861 {"AGT", -180, FALSE}, // ICU Link - America/Argentina/Buenos_Aires | 850 {"AGT", -180, FALSE}, // ICU Link - America/Argentina/Buenos_Aires |
| 862 {"BET", -180, TRUE}, // ICU Link - America/Sao_Paulo | 851 {"BET", -180, TRUE}, // ICU Link - America/Sao_Paulo |
| 863 {"GMT", 0, FALSE}, // Olson etcetera Link - Etc/GMT | 852 {"GMT", 0, FALSE}, // Olson etcetera Link - Etc/GMT |
| 864 {"UTC", 0, FALSE}, // Olson etcetera 0 | 853 {"UTC", 0, FALSE}, // Olson etcetera 0 |
| 865 {"ECT", 60, TRUE}, // ICU Link - Europe/Paris | 854 {"ECT", 60, TRUE}, // ICU Link - Europe/Paris |
| 866 {"MET", 60, TRUE}, // Olson europe 1:00 C-Eur | 855 {"MET", 60, TRUE}, // Olson europe 1:00 C-Eur |
| 867 {"CAT", 120, FALSE}, // ICU Link - Africa/Harare | 856 {"CAT", 120, FALSE}, // ICU Link - Africa/Maputo |
| 868 {"ART", 120, FALSE}, // ICU Link - Africa/Cairo | 857 {"ART", 120, TRUE}, // ICU Link - Africa/Cairo |
| 869 {"EET", 120, TRUE}, // Olson europe 2:00 EU | 858 {"EET", 120, TRUE}, // Olson europe 2:00 EU |
| 870 {"EAT", 180, FALSE}, // ICU Link - Africa/Addis_Ababa | 859 {"EAT", 180, FALSE}, // ICU Link - Africa/Addis_Ababa |
| 871 {"NET", 240, FALSE}, // ICU Link - Asia/Yerevan | 860 {"NET", 240, FALSE}, // ICU Link - Asia/Yerevan |
| 872 {"PLT", 300, FALSE}, // ICU Link - Asia/Karachi | 861 {"PLT", 300, FALSE}, // ICU Link - Asia/Karachi |
| 873 {"IST", 330, FALSE}, // ICU Link - Asia/Kolkata | 862 {"IST", 330, FALSE}, // ICU Link - Asia/Kolkata |
| 874 {"BST", 360, FALSE}, // ICU Link - Asia/Dhaka | 863 {"BST", 360, FALSE}, // ICU Link - Asia/Dhaka |
| 875 {"VST", 420, FALSE}, // ICU Link - Asia/Ho_Chi_Minh | 864 {"VST", 420, FALSE}, // ICU Link - Asia/Ho_Chi_Minh |
| 876 {"CTT", 480, FALSE}, // ICU Link - Asia/Shanghai | 865 {"CTT", 480, FALSE}, // ICU Link - Asia/Shanghai |
| 877 {"JST", 540, FALSE}, // ICU Link - Asia/Tokyo | 866 {"JST", 540, FALSE}, // ICU Link - Asia/Tokyo |
| 878 {"ACT", 570, FALSE}, // ICU Link - Australia/Darwin | 867 {"ACT", 570, FALSE}, // ICU Link - Australia/Darwin |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 956 const char* compatibilityMap[] = { | 945 const char* compatibilityMap[] = { |
| 957 // This list is copied from tz.alias. If tz.alias | 946 // This list is copied from tz.alias. If tz.alias |
| 958 // changes, this list must be updated. Current as of Mar 2007 | 947 // changes, this list must be updated. Current as of Mar 2007 |
| 959 "ACT", "Australia/Darwin", | 948 "ACT", "Australia/Darwin", |
| 960 "AET", "Australia/Sydney", | 949 "AET", "Australia/Sydney", |
| 961 "AGT", "America/Buenos_Aires", | 950 "AGT", "America/Buenos_Aires", |
| 962 "ART", "Africa/Cairo", | 951 "ART", "Africa/Cairo", |
| 963 "AST", "America/Anchorage", | 952 "AST", "America/Anchorage", |
| 964 "BET", "America/Sao_Paulo", | 953 "BET", "America/Sao_Paulo", |
| 965 "BST", "Asia/Dhaka", // # spelling changed in 2000h; was Asia/Dacca | 954 "BST", "Asia/Dhaka", // # spelling changed in 2000h; was Asia/Dacca |
| 966 "CAT", "Africa/Harare", | 955 "CAT", "Africa/Maputo", |
| 967 "CNT", "America/St_Johns", | 956 "CNT", "America/St_Johns", |
| 968 "CST", "America/Chicago", | 957 "CST", "America/Chicago", |
| 969 "CTT", "Asia/Shanghai", | 958 "CTT", "Asia/Shanghai", |
| 970 "EAT", "Africa/Addis_Ababa", | 959 "EAT", "Africa/Addis_Ababa", |
| 971 "ECT", "Europe/Paris", | 960 "ECT", "Europe/Paris", |
| 972 // EET Europe/Istanbul # EET is a standard UNIX zone | 961 // EET Europe/Istanbul # EET is a standard UNIX zone |
| 973 // "EST", "America/New_York", # Defined as -05:00 | 962 // "EST", "America/New_York", # Defined as -05:00 |
| 974 // "HST", "Pacific/Honolulu", # Defined as -10:00 | 963 // "HST", "Pacific/Honolulu", # Defined as -10:00 |
| 975 "IET", "America/Indianapolis", | 964 "IET", "America/Indianapolis", |
| 976 "IST", "Asia/Calcutta", | 965 "IST", "Asia/Calcutta", |
| (...skipping 932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1909 { 2009, UCAL_NOVEMBER, 1, 03, 00, 00, -2 }, | 1898 { 2009, UCAL_NOVEMBER, 1, 03, 00, 00, -2 }, |
| 1910 { 2010, UCAL_FEBRUARY, 28, 01, 59, 59, -2 }, | 1899 { 2010, UCAL_FEBRUARY, 28, 01, 59, 59, -2 }, |
| 1911 { 2010, UCAL_FEBRUARY, 28, 02, 00, 00, -3 } | 1900 { 2010, UCAL_FEBRUARY, 28, 02, 00, 00, -3 } |
| 1912 }; | 1901 }; |
| 1913 | 1902 |
| 1914 TimeZone *timezones[] = { &tz1, &tz2 }; | 1903 TimeZone *timezones[] = { &tz1, &tz2 }; |
| 1915 | 1904 |
| 1916 TimeZone *tz; | 1905 TimeZone *tz; |
| 1917 UDate dt; | 1906 UDate dt; |
| 1918 int32_t t, i, raw, dst; | 1907 int32_t t, i, raw, dst; |
| 1919 for (t = 0; t < LENGTHOF(timezones); ++t) { | 1908 for (t = 0; t < UPRV_LENGTHOF(timezones); ++t) { |
| 1920 tz = timezones[t]; | 1909 tz = timezones[t]; |
| 1921 for (i = 0; i < LENGTHOF(data); ++i) { | 1910 for (i = 0; i < UPRV_LENGTHOF(data); ++i) { |
| 1922 gc.set(data[i].year, data[i].month, data[i].day, | 1911 gc.set(data[i].year, data[i].month, data[i].day, |
| 1923 data[i].hour, data[i].minute, data[i].second); | 1912 data[i].hour, data[i].minute, data[i].second); |
| 1924 dt = gc.getTime(status); | 1913 dt = gc.getTime(status); |
| 1925 if (U_FAILURE(status)) { | 1914 if (U_FAILURE(status)) { |
| 1926 errln("test case %d.%d: bad date/time %04d-%02d-%02d %02d:%02d:%
02d", | 1915 errln("test case %d.%d: bad date/time %04d-%02d-%02d %02d:%02d:%
02d", |
| 1927 t, i, | 1916 t, i, |
| 1928 data[i].year, data[i].month + 1, data[i].day, | 1917 data[i].year, data[i].month + 1, data[i].day, |
| 1929 data[i].hour, data[i].minute, data[i].second); | 1918 data[i].hour, data[i].minute, data[i].second); |
| 1930 status = U_ZERO_ERROR; | 1919 status = U_ZERO_ERROR; |
| 1931 continue; | 1920 continue; |
| 1932 } | 1921 } |
| 1933 tz->getOffset(dt, FALSE, raw, dst, status); | 1922 tz->getOffset(dt, FALSE, raw, dst, status); |
| 1934 if (U_FAILURE(status)) { | 1923 if (U_FAILURE(status)) { |
| 1935 errln("test case %d.%d: tz.getOffset(%04d-%02d-%02d %02d:%02d:%0
2d) fails: %s", | 1924 errln("test case %d.%d: tz.getOffset(%04d-%02d-%02d %02d:%02d:%0
2d) fails: %s", |
| 1936 t, i, | 1925 t, i, |
| 1937 data[i].year, data[i].month + 1, data[i].day, | 1926 data[i].year, data[i].month + 1, data[i].day, |
| 1938 data[i].hour, data[i].minute, data[i].second, | 1927 data[i].hour, data[i].minute, data[i].second, |
| 1939 u_errorName(status)); | 1928 u_errorName(status)); |
| 1940 status = U_ZERO_ERROR; | 1929 status = U_ZERO_ERROR; |
| 1941 } else if ((raw + dst) != data[i].offsetHours * U_MILLIS_PER_HOUR) { | 1930 } else if ((raw + dst) != data[i].offsetHours * U_MILLIS_PER_HOUR) { |
| 1942 errln("test case %d.%d: tz.getOffset(%04d-%02d-%02d %02d:%02d:%0
2d) returns %d+%d != %d", | 1931 errln("test case %d.%d: tz.getOffset(%04d-%02d-%02d %02d:%02d:%0
2d) returns %d+%d != %d", |
| 1943 t, i, | 1932 t, i, |
| 1944 data[i].year, data[i].month + 1, data[i].day, | 1933 data[i].year, data[i].month + 1, data[i].day, |
| 1945 data[i].hour, data[i].minute, data[i].second, | 1934 data[i].hour, data[i].minute, data[i].second, |
| 1946 raw, dst, data[i].offsetHours * U_MILLIS_PER_HOUR); | 1935 raw, dst, data[i].offsetHours * U_MILLIS_PER_HOUR); |
| 1947 } | 1936 } |
| 1948 } | 1937 } |
| 1949 } | 1938 } |
| 1950 } | 1939 } |
| 1940 |
| 1941 void TimeZoneTest::TestCanonicalIDAPI() { |
| 1942 // Bogus input string. |
| 1943 UnicodeString bogus; |
| 1944 bogus.setToBogus(); |
| 1945 UnicodeString canonicalID; |
| 1946 UErrorCode ec = U_ZERO_ERROR; |
| 1947 UnicodeString *pResult = &TimeZone::getCanonicalID(bogus, canonicalID, ec); |
| 1948 assertEquals("TimeZone::getCanonicalID(bogus) should fail", U_ILLEGAL_ARGUME
NT_ERROR, ec); |
| 1949 assertTrue("TimeZone::getCanonicalID(bogus) should return the dest string",
pResult == &canonicalID); |
| 1950 |
| 1951 // U_FAILURE on input. |
| 1952 UnicodeString berlin("Europe/Berlin"); |
| 1953 ec = U_MEMORY_ALLOCATION_ERROR; |
| 1954 pResult = &TimeZone::getCanonicalID(berlin, canonicalID, ec); |
| 1955 assertEquals("TimeZone::getCanonicalID(failure) should fail", U_MEMORY_ALLOC
ATION_ERROR, ec); |
| 1956 assertTrue("TimeZone::getCanonicalID(failure) should return the dest string"
, pResult == &canonicalID); |
| 1957 |
| 1958 // Valid input should un-bogus the dest string. |
| 1959 canonicalID.setToBogus(); |
| 1960 ec = U_ZERO_ERROR; |
| 1961 pResult = &TimeZone::getCanonicalID(berlin, canonicalID, ec); |
| 1962 assertSuccess("TimeZone::getCanonicalID(bogus dest) should succeed", ec, TRU
E); |
| 1963 assertTrue("TimeZone::getCanonicalID(bogus dest) should return the dest stri
ng", pResult == &canonicalID); |
| 1964 assertFalse("TimeZone::getCanonicalID(bogus dest) should un-bogus the dest s
tring", canonicalID.isBogus()); |
| 1965 assertEquals("TimeZone::getCanonicalID(bogus dest) unexpected result", canon
icalID, berlin, TRUE); |
| 1966 } |
| 1967 |
| 1951 void TimeZoneTest::TestCanonicalID() { | 1968 void TimeZoneTest::TestCanonicalID() { |
| 1952 | 1969 |
| 1953 // Some canonical IDs in CLDR are defined as "Link" | 1970 // Some canonical IDs in CLDR are defined as "Link" |
| 1954 // in Olson tzdata. | 1971 // in Olson tzdata. |
| 1955 static const struct { | 1972 static const struct { |
| 1956 const char *alias; | 1973 const char *alias; |
| 1957 const char *zone; | 1974 const char *zone; |
| 1958 } excluded1[] = { | 1975 } excluded1[] = { |
| 1976 {"Africa/Bamako", "Africa/Abidjan"}, |
| 1977 {"Africa/Bangui", "Africa/Lagos"}, |
| 1978 {"Africa/Banjul", "Africa/Abidjan"}, |
| 1979 {"Africa/Blantyre", "Africa/Maputo"}, |
| 1980 {"Africa/Brazzaville", "Africa/Lagos"}, |
| 1981 {"Africa/Bujumbura", "Africa/Maputo"}, |
| 1982 {"Africa/Conakry", "Africa/Abidjan"}, |
| 1983 {"Africa/Dakar", "Africa/Abidjan"}, |
| 1984 {"Africa/Douala", "Africa/Lagos"}, |
| 1985 {"Africa/Freetown", "Africa/Abidjan"}, |
| 1986 {"Africa/Gaborone", "Africa/Maputo"}, |
| 1987 {"Africa/Harare", "Africa/Maputo"}, |
| 1959 {"Africa/Khartoum", "Africa/Juba"}, | 1988 {"Africa/Khartoum", "Africa/Juba"}, |
| 1960 {"America/Shiprock", "America/Denver"}, // America/Shiprock is defined a
s a Link to America/Denver in tzdata | 1989 {"Africa/Kigali", "Africa/Maputo"}, |
| 1990 {"Africa/Kinshasa", "Africa/Lagos"}, |
| 1991 {"Africa/Libreville", "Africa/Lagos"}, |
| 1992 {"Africa/Lome", "Africa/Abidjan"}, |
| 1993 {"Africa/Luanda", "Africa/Lagos"}, |
| 1994 {"Africa/Lubumbashi", "Africa/Maputo"}, |
| 1995 {"Africa/Lusaka", "Africa/Maputo"}, |
| 1996 {"Africa/Maseru", "Africa/Johannesburg"}, |
| 1997 {"Africa/Malabo", "Africa/Lagos"}, |
| 1998 {"Africa/Mbabane", "Africa/Johannesburg"}, |
| 1999 {"Africa/Niamey", "Africa/Lagos"}, |
| 2000 {"Africa/Nouakchott", "Africa/Abidjan"}, |
| 2001 {"Africa/Ouagadougou", "Africa/Abidjan"}, |
| 2002 {"Africa/Porto-Novo", "Africa/Lagos"}, |
| 2003 {"Africa/Sao_Tome", "Africa/Abidjan"}, |
| 2004 {"America/Curacao", "America/Aruba"}, |
| 1961 {"America/Dominica", "America/Anguilla"}, | 2005 {"America/Dominica", "America/Anguilla"}, |
| 1962 {"America/Grenada", "America/Anguilla"}, | 2006 {"America/Grenada", "America/Anguilla"}, |
| 1963 {"America/Guadeloupe", "America/Anguilla"}, | 2007 {"America/Guadeloupe", "America/Anguilla"}, |
| 2008 {"America/Kralendijk", "America/Aruba"}, |
| 2009 {"America/Lower_Princes", "America/Aruba"}, |
| 1964 {"America/Marigot", "America/Anguilla"}, | 2010 {"America/Marigot", "America/Anguilla"}, |
| 1965 {"America/Montserrat", "America/Anguilla"}, | 2011 {"America/Montserrat", "America/Anguilla"}, |
| 1966 {"America/Port_of_Spain", "America/Anguilla"}, | 2012 {"America/Port_of_Spain", "America/Anguilla"}, |
| 2013 {"America/Shiprock", "America/Denver"}, // America/Shiprock is defined a
s a Link to America/Denver in tzdata |
| 1967 {"America/St_Barthelemy", "America/Anguilla"}, | 2014 {"America/St_Barthelemy", "America/Anguilla"}, |
| 1968 {"America/St_Kitts", "America/Anguilla"}, | 2015 {"America/St_Kitts", "America/Anguilla"}, |
| 1969 {"America/St_Lucia", "America/Anguilla"}, | 2016 {"America/St_Lucia", "America/Anguilla"}, |
| 1970 {"America/St_Thomas", "America/Anguilla"}, | 2017 {"America/St_Thomas", "America/Anguilla"}, |
| 1971 {"America/St_Vincent", "America/Anguilla"}, | 2018 {"America/St_Vincent", "America/Anguilla"}, |
| 1972 {"America/Tortola", "America/Anguilla"}, | 2019 {"America/Tortola", "America/Anguilla"}, |
| 1973 {"America/Virgin", "America/Anguilla"}, | 2020 {"America/Virgin", "America/Anguilla"}, |
| 1974 {"America/Curacao", "America/Aruba"}, | |
| 1975 {"America/Kralendijk", "America/Aruba"}, | |
| 1976 {"America/Lower_Princes", "America/Aruba"}, | |
| 1977 {"Antarctica/South_Pole", "Antarctica/McMurdo"}, | 2021 {"Antarctica/South_Pole", "Antarctica/McMurdo"}, |
| 2022 {"Arctic/Longyearbyen", "Europe/Oslo"}, |
| 1978 {"Atlantic/Jan_Mayen", "Europe/Oslo"}, | 2023 {"Atlantic/Jan_Mayen", "Europe/Oslo"}, |
| 1979 {"Arctic/Longyearbyen", "Europe/Oslo"}, | 2024 {"Atlantic/St_Helena", "Africa/Abidjan"}, |
| 2025 {"Europe/Bratislava", "Europe/Prague"}, |
| 1980 {"Europe/Busingen", "Europe/Zurich"}, | 2026 {"Europe/Busingen", "Europe/Zurich"}, |
| 1981 {"Europe/Guernsey", "Europe/London"}, | 2027 {"Europe/Guernsey", "Europe/London"}, |
| 1982 {"Europe/Isle_of_Man", "Europe/London"}, | 2028 {"Europe/Isle_of_Man", "Europe/London"}, |
| 1983 {"Europe/Jersey", "Europe/London"}, | 2029 {"Europe/Jersey", "Europe/London"}, |
| 1984 {"Europe/Ljubljana", "Europe/Belgrade"}, | 2030 {"Europe/Ljubljana", "Europe/Belgrade"}, |
| 2031 {"Europe/Mariehamn", "Europe/Helsinki"}, |
| 1985 {"Europe/Podgorica", "Europe/Belgrade"}, | 2032 {"Europe/Podgorica", "Europe/Belgrade"}, |
| 2033 {"Europe/San_Marino", "Europe/Rome"}, |
| 1986 {"Europe/Sarajevo", "Europe/Belgrade"}, | 2034 {"Europe/Sarajevo", "Europe/Belgrade"}, |
| 1987 {"Europe/Skopje", "Europe/Belgrade"}, | 2035 {"Europe/Skopje", "Europe/Belgrade"}, |
| 2036 {"Europe/Vaduz", "Europe/Zurich"}, |
| 2037 {"Europe/Vatican", "Europe/Rome"}, |
| 1988 {"Europe/Zagreb", "Europe/Belgrade"}, | 2038 {"Europe/Zagreb", "Europe/Belgrade"}, |
| 1989 {"Europe/Bratislava", "Europe/Prague"}, | |
| 1990 {"Europe/Mariehamn", "Europe/Helsinki"}, | |
| 1991 {"Europe/San_Marino", "Europe/Rome"}, | |
| 1992 {"Europe/Vatican", "Europe/Rome"}, | |
| 1993 {"Europe/Vaduz", "Europe/Zurich"}, | |
| 1994 {"Pacific/Auckland", "Antarctica/McMurdo"}, | 2039 {"Pacific/Auckland", "Antarctica/McMurdo"}, |
| 1995 {"Pacific/Johnston", "Pacific/Honolulu"}, | 2040 {"Pacific/Johnston", "Pacific/Honolulu"}, |
| 1996 {0, 0} | 2041 {0, 0} |
| 1997 }; | 2042 }; |
| 1998 | 2043 |
| 1999 // Following IDs are aliases of Etc/GMT in CLDR, | 2044 // Following IDs are aliases of Etc/GMT in CLDR, |
| 2000 // but Olson tzdata has 3 independent definitions | 2045 // but Olson tzdata has 3 independent definitions |
| 2001 // for Etc/GMT, Etc/UTC, Etc/UCT. | 2046 // for Etc/GMT, Etc/UTC, Etc/UCT. |
| 2002 // Until we merge them into one equivalent group | 2047 // Until we merge them into one equivalent group |
| 2003 // in zoneinfo.res, we exclude them in the test | 2048 // in zoneinfo.res, we exclude them in the test |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2234 {"America/Los_Angeles", "US"}, | 2279 {"America/Los_Angeles", "US"}, |
| 2235 {"America/Indianapolis", "US"}, // CLDR canonical, Olson bac
kward | 2280 {"America/Indianapolis", "US"}, // CLDR canonical, Olson bac
kward |
| 2236 {"America/Indiana/Indianapolis", "US"}, // CLDR alias | 2281 {"America/Indiana/Indianapolis", "US"}, // CLDR alias |
| 2237 {"Mexico/General", "MX"}, // Link America/Mexico_City,
Olson backward | 2282 {"Mexico/General", "MX"}, // Link America/Mexico_City,
Olson backward |
| 2238 {"Etc/UTC", "001"}, | 2283 {"Etc/UTC", "001"}, |
| 2239 {"EST5EDT", "001"}, | 2284 {"EST5EDT", "001"}, |
| 2240 {"PST", "US"}, // Link America/Los_Angeles | 2285 {"PST", "US"}, // Link America/Los_Angeles |
| 2241 {"Europe/Helsinki", "FI"}, | 2286 {"Europe/Helsinki", "FI"}, |
| 2242 {"Europe/Mariehamn", "AX"}, // Link Europe/Helsinki, but
in zone.tab | 2287 {"Europe/Mariehamn", "AX"}, // Link Europe/Helsinki, but
in zone.tab |
| 2243 {"Asia/Riyadh", "SA"}, | 2288 {"Asia/Riyadh", "SA"}, |
| 2244 {"Asia/Riyadh87", "001"}, // this should be "SA" actua
lly, but not in zone.tab | 2289 // tz file solar87 was removed from tzdata2013i |
| 2290 // {"Asia/Riyadh87", "001"}, // this should be "SA" ac
tually, but not in zone.tab |
| 2245 {"Etc/Unknown", 0}, // CLDR canonical, but not a sy
smte zone ID | 2291 {"Etc/Unknown", 0}, // CLDR canonical, but not a sy
smte zone ID |
| 2246 {"bogus", 0}, // bogus | 2292 {"bogus", 0}, // bogus |
| 2247 {"GMT+08:00", 0}, // a custom ID, not a system zo
ne ID | 2293 {"GMT+08:00", 0}, // a custom ID, not a system zo
ne ID |
| 2248 {0, 0} | 2294 {0, 0} |
| 2249 }; | 2295 }; |
| 2250 | 2296 |
| 2251 int32_t i; | 2297 int32_t i; |
| 2252 char region[4]; | 2298 char region[4]; |
| 2253 UErrorCode sts; | 2299 UErrorCode sts; |
| 2254 for (i = 0; data[i].id; i++) { | 2300 for (i = 0; data[i].id; i++) { |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2371 UnicodeString id; | 2417 UnicodeString id; |
| 2372 | 2418 |
| 2373 TimeZone::getIDForWindowsID(UnicodeString(TESTDATA[i].winid), TESTDATA[i
].region, | 2419 TimeZone::getIDForWindowsID(UnicodeString(TESTDATA[i].winid), TESTDATA[i
].region, |
| 2374 id, sts); | 2420 id, sts); |
| 2375 assertSuccess(UnicodeString(TESTDATA[i].winid) + "/" + TESTDATA[i].regio
n, sts); | 2421 assertSuccess(UnicodeString(TESTDATA[i].winid) + "/" + TESTDATA[i].regio
n, sts); |
| 2376 assertEquals(UnicodeString(TESTDATA[i].winid) + "/" + TESTDATA[i].region
, TESTDATA[i].id, id, TRUE); | 2422 assertEquals(UnicodeString(TESTDATA[i].winid) + "/" + TESTDATA[i].region
, TESTDATA[i].id, id, TRUE); |
| 2377 } | 2423 } |
| 2378 } | 2424 } |
| 2379 | 2425 |
| 2380 #endif /* #if !UCONFIG_NO_FORMATTING */ | 2426 #endif /* #if !UCONFIG_NO_FORMATTING */ |
| OLD | NEW |