ICU-953 Less static initialization.

X-SVN-Rev: 5443
This commit is contained in:
George Rhoten 2001-08-06 20:11:43 +00:00
parent f4b731202e
commit 4a03a13259
2 changed files with 31 additions and 32 deletions

View file

@ -41,28 +41,27 @@ void TimeZoneBoundaryTest::runIndexedTest( int32_t index, UBool exec, const char
// *****************************************************************************
// class TimeZoneBoundaryTest
// *****************************************************************************
UDate TimeZoneBoundaryTest::ONE_SECOND = 1000;
UDate TimeZoneBoundaryTest::ONE_MINUTE = 60 * ONE_SECOND;
UDate TimeZoneBoundaryTest::ONE_HOUR = 60 * ONE_MINUTE;
UDate TimeZoneBoundaryTest::ONE_DAY = 24 * ONE_HOUR;
UDate TimeZoneBoundaryTest::ONE_YEAR = uprv_floor(365.25 * ONE_DAY);
UDate TimeZoneBoundaryTest::SIX_MONTHS = ONE_YEAR / 2;
int32_t TimeZoneBoundaryTest::MONTH_LENGTH[] = {
TimeZoneBoundaryTest::TimeZoneBoundaryTest()
:
ONE_SECOND(1000),
ONE_MINUTE(60 * ONE_SECOND),
ONE_HOUR(60 * ONE_MINUTE),
ONE_DAY(24 * ONE_HOUR),
ONE_YEAR(uprv_floor(365.25 * ONE_DAY)),
SIX_MONTHS(ONE_YEAR / 2)
{
}
const int32_t TimeZoneBoundaryTest::MONTH_LENGTH[] = {
31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
};
UDate TimeZoneBoundaryTest::PST_1997_BEG = 860320800000.0;
const UDate TimeZoneBoundaryTest::PST_1997_BEG = 860320800000.0;
UDate TimeZoneBoundaryTest::PST_1997_END = 877856400000.0;
const UDate TimeZoneBoundaryTest::PST_1997_END = 877856400000.0;
UDate TimeZoneBoundaryTest::INTERVAL = 10;
const UDate TimeZoneBoundaryTest::INTERVAL = 10;
// -------------------------------------

View file

@ -20,16 +20,9 @@ class TimeZoneBoundaryTest: public CalendarTimeZoneTest {
// IntlTest override
void runIndexedTest( int32_t index, UBool exec, const char* &name, char* par );
public: // package
static UDate ONE_SECOND;
static UDate ONE_MINUTE;
static UDate ONE_HOUR;
static UDate ONE_DAY;
static UDate ONE_YEAR;
static UDate SIX_MONTHS;
static int32_t MONTH_LENGTH[];
static UDate PST_1997_BEG;
static UDate PST_1997_END;
static UDate INTERVAL;
TimeZoneBoundaryTest();
/**
* Date.toString().substring() Boundary Test
* Look for a DST changeover to occur within 6 months of the given Date.
@ -57,37 +50,44 @@ public: // package
*/
virtual void verifyDST(UDate d, TimeZone* time_zone, UBool expUseDaylightTime, UBool expInDaylightTime, UDate expZoneOffset, UDate expDSTOffset);
public:
/**
* Test the behavior of SimpleTimeZone at the transition into and out of DST.
* Use a binary search to find boundaries.
*/
virtual void TestBoundaries(void);
public: // package
/**
* internal subroutine used by TestNewRules
**/
virtual void testUsingBinarySearch(SimpleTimeZone* tz, UDate d, UDate expectedBoundary);
public:
/**
* Test the handling of the "new" rules; that is, rules other than nth Day of week.
*/
virtual void TestNewRules(void);
public: // package
/**
* Find boundaries by stepping.
*/
virtual void findBoundariesStepwise(int32_t year, UDate interval, TimeZone* z, int32_t expectedChanges);
public:
/**
* Test the behavior of SimpleTimeZone at the transition into and out of DST.
* Use a stepwise march to find boundaries.
*/
virtual void TestStepwise(void);
private:
const UDate ONE_SECOND;
const UDate ONE_MINUTE;
const UDate ONE_HOUR;
const UDate ONE_DAY;
const UDate ONE_YEAR;
const UDate SIX_MONTHS;
static const int32_t MONTH_LENGTH[];
static const UDate PST_1997_BEG;
static const UDate PST_1997_END;
static const UDate INTERVAL;
};
#endif // __TimeZoneBoundaryTest__