]>
git.saurik.com Git - apple/icu.git/blob - icuSources/test/intltest/tztest.h
2 /********************************************************************
3 * Copyright (c) 1997-2010, International Business Machines
4 * Corporation and others. All Rights Reserved.
5 ********************************************************************/
7 #ifndef __TimeZoneTest__
8 #define __TimeZoneTest__
10 #include "unicode/utypes.h"
12 #if !UCONFIG_NO_FORMATTING
14 #include "unicode/simpletz.h"
18 * Various tests for TimeZone
20 class TimeZoneTest
: public CalendarTimeZoneTest
{
22 void runIndexedTest( int32_t index
, UBool exec
, const char* &name
, char* par
);
24 static const int32_t millisPerHour
;
28 * Test the offset of the PRT timezone.
30 virtual void TestPRTOffset(void);
32 * Regress a specific bug with a sequence of API calls.
34 virtual void TestVariousAPI518(void);
36 * Test the call which retrieves the available IDs.
38 virtual void TestGetAvailableIDs913(void);
41 * Generic API testing for API coverage.
43 virtual void TestGenericAPI(void);
45 * Test the setStartRule/setEndRule API calls.
47 virtual void TestRuleAPI(void);
49 void findTransition(const TimeZone
& tz
,
50 UDate min
, UDate max
);
53 * subtest used by TestRuleAPI
55 void testUsingBinarySearch(const TimeZone
& tz
,
57 UDate expectedBoundary
);
61 * Test short zone IDs for compliance
63 virtual void TestShortZoneIDs(void);
67 * Test parsing custom zones
69 virtual void TestCustomParse(void);
72 * Test new getDisplayName() API
74 virtual void TestDisplayName(void);
76 void TestDSTSavings(void);
77 void TestAlternateRules(void);
79 void TestCountries(void);
81 void TestHistorical(void);
83 void TestEquivalentIDs(void);
85 void TestAliasedNames(void);
87 void TestFractionalDST(void);
89 void TestFebruary(void);
91 void TestCanonicalID(void);
93 virtual void TestDisplayNamesMeta();
95 static const UDate INTERVAL
;
99 static UnicodeString
& formatOffset(int32_t offset
, UnicodeString
& rv
);
100 static UnicodeString
& formatTZID(int32_t offset
, UnicodeString
& rv
);
102 // Some test case data is current date/tzdata version sensitive and producing errors
103 // when year/rule are changed.
104 static const int32_t REFERENCE_YEAR
;
105 static const char *REFERENCE_DATA_VERSION
;
108 #endif /* #if !UCONFIG_NO_FORMATTING */
110 #endif // __TimeZoneTest__