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:
parent
80b75a5817
commit
2007dc91e7
@ -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;
|
||||
|
@ -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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user