ICU-5135 Update zoneinfo.txt to 2007c generated by updated tzcode and corresponding test case fixes

X-SVN-Rev: 21146
This commit is contained in:
Yoshito Umaoka 2007-03-02 05:29:16 +00:00
parent 4706047498
commit 6d39b91197
5 changed files with 2464 additions and 2412 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
/***********************************************************************
* COPYRIGHT:
* Copyright (c) 1997-2006, International Business Machines Corporation
* Copyright (c) 1997-2007, International Business Machines Corporation
* and others. All Rights Reserved.
***********************************************************************/
@ -98,7 +98,21 @@ void DateFormatRoundTripTest::TestCentury()
fmt.format(date[1], result[1]);
date[2] = fmt.parse(result[1], status);
if (date[1] != date[2] || result[0] != result[1]) {
/* This test case worked OK by accident before. date[1] != date[0],
* because we use -80/+20 year window for 2-digit year parsing.
* (date[0] is in year 1926, date[1] is in year 2026.) result[1] set
* by the first format call returns "07/13/26 07:48:28 p.m. PST",
* which is correct, because DST was not used in year 1926 in zone
* America/Los_Angeles. When this is parsed, date[1] becomes a time
* in 2026, which is "07/13/26 08:48:28 p.m. PDT". There was a zone
* offset calculation bug that observed DST in 1926, which was resolved.
* Before the bug was resolved, result[0] == result[1] was true,
* but after the bug fix, the expected result is actually
* result[0] != result[1]. We actually need to review this code
* and clarify what we really want to test here. -Yoshito
*/
//if (date[1] != date[2] || result[0] != result[1]) {
if (date[1] != date[2]) {
errln("Round trip failure: \"%S\" (%f), \"%S\" (%f)", result[0].getBuffer(), date[1], result[1].getBuffer(), date[2]);
}
}

View File

@ -1,6 +1,6 @@
/***********************************************************************
* COPYRIGHT:
* Copyright (c) 1997-2005, International Business Machines Corporation
* Copyright (c) 1997-2007, International Business Machines Corporation
* and others. All Rights Reserved.
***********************************************************************/
@ -463,7 +463,18 @@ void IntlCalendarTest::TestJapaneseFormat() {
// Test parse with incomplete information
fmt = new SimpleDateFormat(UnicodeString("G y"), Locale("en_US@calendar=japanese"), status);
aDate = -3197120400000.;
/* The test data below should points to 1868-09-08T00:00:00 in America/Los_Angeles.
* The time calculated by original test code uses -7:00 UTC offset, because it assumes
* DST is observed (because of a timezone bug, DST is observed for early 20th century
* day to infinite past time). The bug was fixed and DST is no longer used for time before
* 1900 for any zones. However, ICU timezone transition data is represented by 32-bit integer
* (sec) and cannot represent transitions before 1901 defined in Olson tzdata. For example,
* based on Olson definition, offset -7:52:58 should be used for Nov 18, 1883 or older dates.
* If ICU properly capture entire Olson zone definition, the start time of "Meiji 1" is
* -3197117222000. -Yoshito
*/
//aDate = -3197120400000.;
aDate = -3197116800000.;
CHECK(status, "creating date format instance");
if(!fmt) {
errln("Coudln't create en_US instance");
@ -515,7 +526,8 @@ void IntlCalendarTest::TestJapaneseFormat() {
}
{
UnicodeString expect = CharsToUnicodeString("\\u5b89\\u6c385\\u5e747\\u67084\\u65e5\\u6728\\u66dc\\u65e5");
UDate expectDate = -6106035600000.0;
//UDate expectDate = -6106035600000.0;
UDate expectDate = -6106032000000.0; // 1776-07-04T00:00:00Z-0800
Locale loc("ja_JP@calendar=japanese");
status = U_ZERO_ERROR;
@ -534,7 +546,8 @@ void IntlCalendarTest::TestJapaneseFormat() {
{ // This Feb 29th falls on a leap year by gregorian year, but not by Japanese year.
UnicodeString expect = CharsToUnicodeString("\\u5EB7\\u6B632\\u5e742\\u670829\\u65e5\\u65e5\\u66dc\\u65e5");
// Add -1:00 to the following for historical TZ - aliu
UDate expectDate = -16214403600000.0; // courtesy of date format round trip test
//UDate expectDate = -16214403600000.0; // courtesy of date format round trip test
UDate expectDate = -16214400000000.0; // 1456-03-09T00:00:00Z-0800
Locale loc("ja_JP@calendar=japanese");
status = U_ZERO_ERROR;

View File

@ -482,8 +482,19 @@ void TimeZoneRegressionTest:: Test4126678()
failure(status, "cal->get");
int32_t offset = tz->getOffset((uint8_t)era, year, month, day, (uint8_t)dayOfWeek, millis, status);
int32_t raw_offset = tz->getRawOffset();
/* Because of better historical timezone support based on Olson data,
* DST is not observed in year 98. Thus, the expected result is changed.
* As of Mar 2007, ICU timezone transition data is represented by 32-bit.
* When we support 64-bit Olson transition data, the actual offset in
* AD 98 for America/Los_Angeles will be changed again (-7:52:58). Until
* then, expected result is offset == raw_offset. -Yoshito
*/
/*
if (offset == raw_offset)
errln("Offsets should not match when in DST");
*/
if (offset != raw_offset)
errln("Offsets should match");
delete cal;
}

View File

@ -681,14 +681,14 @@ void TimeZoneTest::TestShortZoneIDs()
const char* compatibilityMap[] = {
// This list is copied from tz.alias. If tz.alias
// changes, this list must be updated. Current as of Aug 2003
// changes, this list must be updated. Current as of Mar 2007
"ACT", "Australia/Darwin",
"AET", "Australia/Sydney",
"AGT", "America/Buenos_Aires",
"ART", "Africa/Cairo",
"AST", "America/Anchorage",
"BET", "America/Sao_Paulo",
"BST", "Asia/Dhaka", // Spelling changed in 2000h
"BST", "Asia/Dhaka", // # spelling changed in 2000h; was Asia/Dacca
"CAT", "Africa/Harare",
"CNT", "America/St_Johns",
"CST", "America/Chicago",
@ -696,14 +696,14 @@ void TimeZoneTest::TestShortZoneIDs()
"EAT", "Africa/Addis_Ababa",
"ECT", "Europe/Paris",
// EET Europe/Istanbul # EET is a standard UNIX zone
// "EST", "America/New_York", # EST is an Olson alias now (2003)
"HST", "Pacific/Honolulu",
// "EST", "America/New_York", # Defined as -05:00
// "HST", "Pacific/Honolulu", # Defined as -10:00
"IET", "America/Indianapolis",
"IST", "Asia/Calcutta",
"JST", "Asia/Tokyo",
// MET Asia/Tehran # MET is a standard UNIX zone
"MIT", "Pacific/Apia",
// "MST", "America/Denver", # MST is an Olson alias now (2003)
// "MST", "America/Denver", # Defined as -07:00
"NET", "Asia/Yerevan",
"NST", "Pacific/Auckland",
"PLT", "Asia/Karachi",