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