]>
Commit | Line | Data |
---|---|---|
b75a7d8f A |
1 | |
2 | /******************************************************************** | |
57a6839d | 3 | * Copyright (c) 1997-2014, International Business Machines |
46f4442e | 4 | * Corporation and others. All Rights Reserved. |
b75a7d8f A |
5 | ********************************************************************/ |
6 | ||
7 | #ifndef __TimeZoneTest__ | |
8 | #define __TimeZoneTest__ | |
9 | ||
10 | #include "unicode/utypes.h" | |
11 | ||
12 | #if !UCONFIG_NO_FORMATTING | |
13 | ||
14 | #include "unicode/simpletz.h" | |
15 | #include "caltztst.h" | |
16 | ||
17 | /** | |
18 | * Various tests for TimeZone | |
19 | **/ | |
20 | class TimeZoneTest: public CalendarTimeZoneTest { | |
21 | // IntlTest override | |
22 | void runIndexedTest( int32_t index, UBool exec, const char* &name, char* par ); | |
23 | public: // package | |
24 | static const int32_t millisPerHour; | |
25 | ||
26 | public: | |
27 | /** | |
28 | * Test the offset of the PRT timezone. | |
29 | */ | |
30 | virtual void TestPRTOffset(void); | |
31 | /** | |
32 | * Regress a specific bug with a sequence of API calls. | |
33 | */ | |
34 | virtual void TestVariousAPI518(void); | |
35 | /** | |
36 | * Test the call which retrieves the available IDs. | |
37 | */ | |
38 | virtual void TestGetAvailableIDs913(void); | |
39 | ||
4388f060 A |
40 | virtual void TestGetAvailableIDsNew(void); |
41 | ||
b75a7d8f A |
42 | /** |
43 | * Generic API testing for API coverage. | |
44 | */ | |
45 | virtual void TestGenericAPI(void); | |
46 | /** | |
47 | * Test the setStartRule/setEndRule API calls. | |
48 | */ | |
49 | virtual void TestRuleAPI(void); | |
374ca955 A |
50 | |
51 | void findTransition(const TimeZone& tz, | |
52 | UDate min, UDate max); | |
b75a7d8f | 53 | |
374ca955 | 54 | /** |
b75a7d8f A |
55 | * subtest used by TestRuleAPI |
56 | **/ | |
374ca955 A |
57 | void testUsingBinarySearch(const TimeZone& tz, |
58 | UDate min, UDate max, | |
59 | UDate expectedBoundary); | |
b75a7d8f A |
60 | |
61 | ||
62 | /** | |
63 | * Test short zone IDs for compliance | |
64 | */ | |
65 | virtual void TestShortZoneIDs(void); | |
66 | ||
67 | ||
68 | /** | |
69 | * Test parsing custom zones | |
70 | */ | |
71 | virtual void TestCustomParse(void); | |
72 | ||
73 | /** | |
74 | * Test new getDisplayName() API | |
75 | */ | |
76 | virtual void TestDisplayName(void); | |
77 | ||
78 | void TestDSTSavings(void); | |
79 | void TestAlternateRules(void); | |
80 | ||
81 | void TestCountries(void); | |
82 | ||
374ca955 A |
83 | void TestHistorical(void); |
84 | ||
85 | void TestEquivalentIDs(void); | |
86 | ||
73c04bcf A |
87 | void TestAliasedNames(void); |
88 | ||
89 | void TestFractionalDST(void); | |
46f4442e A |
90 | |
91 | void TestFebruary(void); | |
92 | ||
57a6839d | 93 | void TestCanonicalIDAPI(); |
46f4442e | 94 | void TestCanonicalID(void); |
4388f060 | 95 | |
46f4442e A |
96 | virtual void TestDisplayNamesMeta(); |
97 | ||
4388f060 A |
98 | void TestGetRegion(void); |
99 | void TestGetUnknown(); | |
100 | ||
57a6839d A |
101 | void TestGetWindowsID(void); |
102 | void TestGetIDForWindowsID(void); | |
103 | ||
b75a7d8f A |
104 | static const UDate INTERVAL; |
105 | ||
106 | private: | |
107 | // internal functions | |
46f4442e A |
108 | static UnicodeString& formatOffset(int32_t offset, UnicodeString& rv); |
109 | static UnicodeString& formatTZID(int32_t offset, UnicodeString& rv); | |
110 | ||
111 | // Some test case data is current date/tzdata version sensitive and producing errors | |
112 | // when year/rule are changed. | |
113 | static const int32_t REFERENCE_YEAR; | |
114 | static const char *REFERENCE_DATA_VERSION; | |
4388f060 A |
115 | |
116 | void checkContainsAll(StringEnumeration *s1, const char *name1, | |
117 | StringEnumeration *s2, const char *name2); | |
b75a7d8f A |
118 | }; |
119 | ||
120 | #endif /* #if !UCONFIG_NO_FORMATTING */ | |
121 | ||
122 | #endif // __TimeZoneTest__ |