ICU-5619 Fix Windows test failure when the timezone is GMT+5:45, and fix a documentation typo.
X-SVN-Rev: 21119
This commit is contained in:
parent
0645826dce
commit
7d227b0bd2
@ -1,6 +1,7 @@
|
||||
/*
|
||||
* Copyright (C) {1997-2005}, International Business Machines Corporation and others. All Rights Reserved.
|
||||
********************************************************************************
|
||||
/*************************************************************************
|
||||
* Copyright (c) 1997-2007, International Business Machines Corporation
|
||||
* and others. All Rights Reserved.
|
||||
**************************************************************************
|
||||
*
|
||||
* File TIMEZONE.H
|
||||
*
|
||||
@ -20,7 +21,7 @@
|
||||
* Hashtable replaced by new static data structures.
|
||||
* 12/14/99 aliu Made GMT public.
|
||||
* 08/15/01 grhoten Made GMT private and added the getGMT() function
|
||||
********************************************************************************
|
||||
**************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef TIMEZONE_H
|
||||
@ -305,7 +306,7 @@ public:
|
||||
static TimeZone* U_EXPORT2 createDefault(void);
|
||||
|
||||
/**
|
||||
* Sets the default time zone (i.e., what's returned by getDefault()) to be the
|
||||
* Sets the default time zone (i.e., what's returned by createDefault()) to be the
|
||||
* specified time zone. If NULL is specified for the time zone, the default time
|
||||
* zone is set to the default host time zone. This call adopts the TimeZone object
|
||||
* passed in; the clent is no longer responsible for deleting it.
|
||||
|
@ -90,7 +90,7 @@ TimeZoneTest::TestGenericAPI()
|
||||
|
||||
TimeZone* saveDefault = TimeZone::createDefault();
|
||||
logln((UnicodeString)"TimeZone::createDefault() => " + saveDefault->getID(id));
|
||||
//TimeZone* pstZone = TimeZone::createTimeZone("PST");
|
||||
TimeZone* pstZone = TimeZone::createTimeZone("America/Los_Angeles");
|
||||
|
||||
logln("call uprv_timezone() which uses the host");
|
||||
logln("to get the difference in seconds between coordinated universal");
|
||||
@ -101,17 +101,12 @@ TimeZoneTest::TestGenericAPI()
|
||||
// Invert sign because UNIX semantics are backwards
|
||||
if (tzoffset < 0)
|
||||
tzoffset = -tzoffset;
|
||||
// --- The following test would fail outside PST now that
|
||||
// --- PST is generally set to be default timezone in format tests
|
||||
//if ((*saveDefault == *pstZone) && (tzoffset != 28800)) {
|
||||
// errln("FAIL: t_timezone may be incorrect. It is not 28800");
|
||||
//}
|
||||
|
||||
if (tzoffset != 28800) {
|
||||
logln("***** WARNING: If testing in the PST timezone, uprv_timezone should return 28800! *****");
|
||||
if ((*saveDefault == *pstZone) && (tzoffset != 28800)) {
|
||||
errln("FAIL: t_timezone may be incorrect. It is not 28800");
|
||||
}
|
||||
if ((tzoffset % 1800 != 0)) {
|
||||
errln("FAIL: t_timezone may be incorrect. It is not a multiple of 30min. It is %d", tzoffset);
|
||||
|
||||
if ((tzoffset % 900) != 0) {
|
||||
errln("FAIL: t_timezone may be incorrect. It is not a multiple of 15min. It is %d", tzoffset);
|
||||
}
|
||||
|
||||
TimeZone::adoptDefault(zone);
|
||||
@ -122,7 +117,7 @@ TimeZoneTest::TestGenericAPI()
|
||||
TimeZone::adoptDefault(saveDefault);
|
||||
delete defaultzone;
|
||||
delete zoneclone;
|
||||
//delete pstZone;
|
||||
delete pstZone;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user