ICU-10462 ICU4C Intltest to use America/Los_Angeles as the default time zone instead of PST.

X-SVN-Rev: 34556
This commit is contained in:
Yoshito Umaoka 2013-10-10 23:02:15 +00:00
parent 80b75a5817
commit 2007dc91e7
2 changed files with 10 additions and 20 deletions

View File

@ -80,7 +80,7 @@ void IntlTestFormat::runIndexedTest( int32_t index, UBool exec, const char* &nam
Locale saveDefaultLocale = Locale::getDefault();
if (exec) {
saveDefaultTimeZone = TimeZone::createDefault();
TimeZone *tz = TimeZone::createTimeZone("PST");
TimeZone *tz = TimeZone::createTimeZone("America/Los_Angeles");
TimeZone::setDefault(*tz);
delete tz;
UErrorCode status = U_ZERO_ERROR;

View File

@ -110,21 +110,21 @@ TimeZoneTest::TestGenericAPI()
TimeZone* saveDefault = TimeZone::createDefault();
logln((UnicodeString)"TimeZone::createDefault() => " + saveDefault->getID(id));
TimeZone* pstZone = TimeZone::createTimeZone("America/Los_Angeles");
TimeZone::adoptDefault(zone);
TimeZone* defaultzone = TimeZone::createDefault();
if (defaultzone == zone ||
!(*defaultzone == *zone))
errln("FAIL: createDefault failed");
TimeZone::adoptDefault(saveDefault);
delete defaultzone;
delete zoneclone;
logln("call uprv_timezone() which uses the host");
logln("to get the difference in seconds between coordinated universal");
logln("time and local time. E.g., -28,800 for PST (GMT-8hrs)");
int32_t tzoffset = uprv_timezone();
logln(UnicodeString("Value returned from uprv_timezone = ") + tzoffset);
// Invert sign because UNIX semantics are backwards
if (tzoffset < 0)
tzoffset = -tzoffset;
if ((*saveDefault == *pstZone) && (tzoffset != 28800)) {
errln("FAIL: t_timezone may be incorrect. It is not 28800");
}
if ((tzoffset % 900) != 0) {
/*
* Ticket#6364 and #7648
@ -136,16 +136,6 @@ TimeZoneTest::TestGenericAPI()
infoln("WARNING: t_timezone may be incorrect. It is not a multiple of 15min.", tzoffset);
}
TimeZone::adoptDefault(zone);
TimeZone* defaultzone = TimeZone::createDefault();
if (defaultzone == zone ||
!(*defaultzone == *zone))
errln("FAIL: createDefault failed");
TimeZone::adoptDefault(saveDefault);
delete defaultzone;
delete zoneclone;
delete pstZone;
UErrorCode status = U_ZERO_ERROR;
const char* tzver = TimeZone::getTZDataVersion(status);
if (U_FAILURE(status)) {