File: tztest.h

package info (click to toggle)
icu 78.2-2
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 123,988 kB
  • sloc: cpp: 527,891; ansic: 112,789; sh: 4,983; makefile: 4,657; perl: 3,199; python: 2,933; xml: 749; sed: 36; lisp: 12
file content (130 lines) | stat: -rw-r--r-- 3,217 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html

/********************************************************************
 * Copyright (c) 1997-2014, International Business Machines
 * Corporation and others. All Rights Reserved.
 ********************************************************************/
 
#ifndef __TimeZoneTest__
#define __TimeZoneTest__

#include "unicode/utypes.h"

#if !UCONFIG_NO_FORMATTING

#include "unicode/simpletz.h" 
#include "caltztst.h"

/** 
 * Various tests for TimeZone
 **/
class TimeZoneTest: public CalendarTimeZoneTest {
    // IntlTest override
    void runIndexedTest( int32_t index, UBool exec, const char* &name, char* par ) override;
public: // package
    static const int32_t millisPerHour;
 
public:
    /**
     * Test the offset of the PRT timezone.
     */
    virtual void TestPRTOffset();
    /**
     * Regress a specific bug with a sequence of API calls.
     */
    virtual void TestVariousAPI518();
    /**
     * Test the call which retrieves the available IDs.
     */
    virtual void TestGetAvailableIDs913();

    virtual void TestGetAvailableIDsNew();

    /**
     * Generic API testing for API coverage.
     */
    virtual void TestGenericAPI();
    /**
     * Test the setStartRule/setEndRule API calls.
     */
    virtual void TestRuleAPI();
 
    void findTransition(const TimeZone& tz,
                        UDate min, UDate max);

   /**
     * subtest used by TestRuleAPI
     **/
    void testUsingBinarySearch(const TimeZone& tz,
                               UDate min, UDate max,
                               UDate expectedBoundary);


    /**
     *  Test short zone IDs for compliance
     */ 
    virtual void TestShortZoneIDs();


    /**
     *  Test parsing custom zones
     */ 
    virtual void TestCustomParse();
    
    /**
     *  Test new getDisplayName() API
     */ 
    virtual void TestDisplayName();

    void TestDSTSavings();
    void TestAlternateRules();

    void TestCountries();

    void TestHistorical();

    void TestEquivalentIDs();

    void TestAliasedNames();
    
    void TestFractionalDST();

    void TestFebruary();

    void TestCanonicalIDAPI();
    void TestCanonicalID();

    virtual void TestDisplayNamesMeta();

    void TestGetRegion();
    void TestGetUnknown();
    void TestGetGMT();

    void TestGetWindowsID();
    void TestGetIDForWindowsID();
    void TestCasablancaNameAndOffset22041();
    void TestRawOffsetAndOffsetConsistency22041();
    void TestGMTMinus24ICU22526();

    void TestGetIanaID();

    static const UDate INTERVAL;

private:
    // internal functions
    static UnicodeString& formatOffset(int32_t offset, UnicodeString& rv);
    static UnicodeString& formatTZID(int32_t offset, UnicodeString& rv);

    // Some test case data is current date/tzdata version sensitive and producing errors
    // when year/rule are changed.
    static const int32_t REFERENCE_YEAR;
    static const char *REFERENCE_DATA_VERSION;

    void checkContainsAll(StringEnumeration *s1, const char *name1,
        StringEnumeration *s2, const char *name2);
};

#endif /* #if !UCONFIG_NO_FORMATTING */
 
#endif // __TimeZoneTest__