]>
Commit | Line | Data |
---|---|---|
374ca955 | 1 | /*********************************************************************** |
b75a7d8f | 2 | * COPYRIGHT: |
57a6839d | 3 | * Copyright (c) 1997-2014, International Business Machines Corporation |
374ca955 A |
4 | * and others. All Rights Reserved. |
5 | ***********************************************************************/ | |
b75a7d8f A |
6 | |
7 | /** | |
8 | * CollationAPITest is a third level test class. This test performs API | |
9 | * related tests for the Collation framework. | |
10 | */ | |
11 | ||
12 | #ifndef _APICOLL | |
13 | #define _APICOLL | |
14 | ||
15 | #include "unicode/utypes.h" | |
16 | ||
17 | #if !UCONFIG_NO_COLLATION | |
18 | ||
19 | #include "unicode/tblcoll.h" | |
20 | #include "tscoll.h" | |
21 | ||
22 | class CollationAPITest: public IntlTestCollator { | |
23 | public: | |
24 | void runIndexedTest( int32_t index, UBool exec, const char* &name, char* /*par = NULL */); | |
25 | void doAssert(UBool condition, const char *message); | |
26 | ||
27 | /** | |
28 | * This tests the properties of a collator object. | |
29 | * - constructor/destructor | |
30 | * - factory method createInstance | |
31 | * - compare and getCollationKey | |
32 | * - get/set decomposition mode and comparison level | |
33 | * - displayable name in the desired locale | |
34 | */ | |
35 | void TestProperty(/* char* par */); | |
36 | ||
37 | /** | |
38 | * This tests the RuleBasedCollator | |
39 | * - constructor/destructor | |
40 | * - getRules | |
41 | */ | |
42 | void TestRuleBasedColl(/* char* par */); | |
43 | ||
44 | /** | |
45 | * This tests the RuleBasedCollator | |
46 | * - getRules | |
47 | */ | |
48 | void TestRules(/* char* par */); | |
49 | ||
50 | /** | |
51 | * Tests decomposition setting | |
52 | */ | |
53 | void TestDecomposition(); | |
54 | ||
55 | /** | |
56 | * SafeClone test | |
57 | */ | |
58 | void TestSafeClone(); | |
59 | ||
60 | /** | |
61 | * This tests the properties of a rule based collator object. | |
62 | * - constructor/destructor | |
63 | * - == and != operators | |
64 | * - clone and copy | |
65 | * - collation rules access | |
66 | */ | |
67 | void TestOperators(/* char* par */); | |
68 | ||
69 | /** | |
70 | * This tests the duplication of a collator object. | |
71 | */ | |
72 | void TestDuplicate(/* char* par */); | |
73 | ||
74 | /** | |
75 | * This tests the comparison convenience methods of a collator object. | |
76 | * - greater than | |
77 | * - greater than or equal to | |
78 | * - equal to | |
79 | */ | |
80 | void TestCompare(/* char* par */); | |
81 | ||
82 | /** | |
83 | * This tests the hashCode method of a collator object. | |
84 | */ | |
85 | void TestHashCode(/* char* par */); | |
86 | ||
87 | /** | |
88 | * This tests the collation key related APIs. | |
89 | * - constructor/destructor | |
90 | * - Collator::getCollationKey | |
91 | * - == and != operators | |
92 | * - comparison between collation keys | |
93 | * - creating collation key with a byte array and vice versa | |
94 | */ | |
95 | void TestCollationKey(/* char* par */); | |
96 | ||
97 | /** | |
98 | * This tests the CollationElementIterator related APIs. | |
99 | * - creation of a CollationElementIterator object | |
100 | * - == and != operators | |
101 | * - iterating forward | |
102 | * - reseting the iterator index | |
103 | * - requesting the order properties(primary, secondary or tertiary) | |
104 | */ | |
105 | void TestElemIter(/* char* par */); | |
106 | ||
107 | /** | |
108 | * This tests the list the all available locales. | |
109 | */ | |
110 | void TestGetAll(/* char* par */); | |
111 | ||
112 | /** | |
113 | * This tests the sort keys generated by collator | |
114 | */ | |
115 | void TestSortKey(); | |
4388f060 | 116 | void TestSortKeyOverflow(); |
b75a7d8f A |
117 | |
118 | /** | |
119 | * This tests getMaxExpansion | |
120 | */ | |
121 | void TestMaxExpansion(); | |
122 | ||
123 | /** | |
124 | * Tests the retrieval of names given a locale | |
125 | */ | |
126 | void TestDisplayName(); | |
127 | ||
128 | /** | |
129 | * Tests the collator attributes | |
130 | */ | |
131 | void TestAttribute(); | |
132 | ||
133 | /** | |
134 | * Tests the setters and getters of variable top | |
135 | */ | |
136 | void TestVariableTopSetting(); | |
57a6839d | 137 | void TestMaxVariable(); |
b75a7d8f A |
138 | |
139 | /** | |
140 | * Tests GetLocale for a Collator | |
141 | */ | |
142 | void TestGetLocale(); | |
143 | ||
144 | /** | |
145 | * Tests bounds API | |
146 | */ | |
147 | void TestBounds(); | |
148 | ||
149 | /** | |
150 | * Tests getTailoredSet API | |
151 | */ | |
152 | void TestGetTailoredSet(); | |
153 | ||
374ca955 | 154 | /** |
b75a7d8f A |
155 | * Tests the subclassability |
156 | */ | |
157 | void TestSubclass(); | |
158 | ||
374ca955 | 159 | /** |
b75a7d8f A |
160 | * Tests the dynamic and static ids of collation classes |
161 | */ | |
162 | void TestUClassID(); | |
163 | ||
374ca955 A |
164 | /** |
165 | * Test NULL | |
166 | */ | |
167 | void TestNULLCharTailoring(); | |
168 | ||
73c04bcf | 169 | void TestClone(); |
57a6839d A |
170 | void TestCloneBinary(); |
171 | void TestIterNumeric(); | |
b331163b | 172 | void TestBadKeywords(); |
57a6839d | 173 | |
b75a7d8f A |
174 | private: |
175 | // If this is too small for the test data, just increase it. | |
176 | // Just don't make it too large, otherwise the executable will get too big | |
177 | enum EToken_Len { MAX_TOKEN_LEN = 16 }; | |
178 | ||
73c04bcf A |
179 | void dump(UnicodeString msg, RuleBasedCollator* c, UErrorCode& status); |
180 | ||
b75a7d8f A |
181 | }; |
182 | ||
183 | #endif /* #if !UCONFIG_NO_COLLATION */ | |
184 | ||
185 | #endif |