]>
git.saurik.com Git - apple/icu.git/blob - icuSources/test/intltest/tztest.h
2 /********************************************************************
3 * Copyright (c) 1997-2014, 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);
40 virtual void TestGetAvailableIDsNew(void);
43 * Generic API testing for API coverage.
45 virtual void TestGenericAPI(void);
47 * Test the setStartRule/setEndRule API calls.
49 virtual void TestRuleAPI(void);
51 void findTransition(const TimeZone
& tz
,
52 UDate min
, UDate max
);
55 * subtest used by TestRuleAPI
57 void testUsingBinarySearch(const TimeZone
& tz
,
59 UDate expectedBoundary
);
63 * Test short zone IDs for compliance
65 virtual void TestShortZoneIDs(void);
69 * Test parsing custom zones
71 virtual void TestCustomParse(void);
74 * Test new getDisplayName() API
76 virtual void TestDisplayName(void);
78 void TestDSTSavings(void);
79 void TestAlternateRules(void);
81 void TestCountries(void);
83 void TestHistorical(void);
85 void TestEquivalentIDs(void);
87 void TestAliasedNames(void);
89 void TestFractionalDST(void);
91 void TestFebruary(void);
93 void TestCanonicalIDAPI();
94 void TestCanonicalID(void);
96 virtual void TestDisplayNamesMeta();
98 void TestGetRegion(void);
99 void TestGetUnknown();
101 void TestGetWindowsID(void);
102 void TestGetIDForWindowsID(void);
104 static const UDate INTERVAL
;
107 // internal functions
108 static UnicodeString
& formatOffset(int32_t offset
, UnicodeString
& rv
);
109 static UnicodeString
& formatTZID(int32_t offset
, UnicodeString
& rv
);
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
;
116 void checkContainsAll(StringEnumeration
*s1
, const char *name1
,
117 StringEnumeration
*s2
, const char *name2
);
120 #endif /* #if !UCONFIG_NO_FORMATTING */
122 #endif // __TimeZoneTest__