blob: f0947eebe51eeef9427b1d58b638cd99381d57c3 [file] [log] [blame]
Fredrik Roubert64339d32016-10-21 19:43:16 +02001// Copyright (C) 2016 and later: Unicode, Inc. and others.
2// License & terms of use: http://www.unicode.org/copyright.html
Jean-Baptiste Querub13da9d2009-07-17 17:53:22 -07003/********************************************************************
4 * COPYRIGHT:
ccorneliusfceb3982014-04-16 12:27:14 -07005 * Copyright (c) 1997-2014, International Business Machines Corporation and
Jean-Baptiste Querub13da9d2009-07-17 17:53:22 -07006 * others. All Rights Reserved.
7 ********************************************************************/
8
9/**
10 * Collation regression tests.
11 * (So we'll have no regrets later)
12 */
13
14#ifndef _REGCOLL
15#define _REGCOLL
16
17#include "unicode/utypes.h"
18
19#if !UCONFIG_NO_COLLATION
20
21#include "unicode/coleitr.h"
22#include "tscoll.h"
23
24class CollationRegressionTest: public IntlTestCollator
25{
26public:
27
28 // If this is too small for the test data, just increase it.
29 // Just don't make it too large, otherwise the executable will get too big
30 enum EToken_Len { MAX_TOKEN_LEN = 32 };
31
32 CollationRegressionTest();
33 virtual ~CollationRegressionTest();
34
35 void runIndexedTest( int32_t index, UBool exec, const char* &name, char* par = NULL );
36
37 // @bug 4048446
38 //
39 // CollationElementIterator.reset() doesn't work
40 //
41 void Test4048446(/* char* par */);
42
43 // @bug 4051866
44 //
45 // Collator -> rules -> Collator round-trip broken for expanding characters
46 //
47 void Test4051866(/* char* par */);
48
49 // @bug 4053636
50 //
51 // Collator thinks "black-bird" == "black"
52 //
53 void Test4053636(/* char* par */);
54
55
56 // @bug 4054238
57 //
58 // CollationElementIterator will not work correctly if the associated
59 // Collator object's mode is changed
60 //
61 void Test4054238(/* char* par */);
62
63 // @bug 4054734
64 //
65 // Collator.IDENTICAL documented but not implemented
66 //
67 void Test4054734(/* char* par */);
68
69 // @bug 4054736
70 //
71 // Full Decomposition mode not implemented
72 //
73 void Test4054736(/* char* par */);
74
75 // @bug 4058613
76 //
77 // Collator.getInstance() causes an ArrayIndexOutofBoundsException for Korean
78 //
79 void Test4058613(/* char* par */);
80
81 // @bug 4059820
82 //
83 // RuleBasedCollator.getRules does not return the exact pattern as input
84 // for expanding character sequences
85 //
86 void Test4059820(/* char* par */);
87
88 // @bug 4060154
89 //
90 // MergeCollation::fixEntry broken for "& H < \u0131, \u0130, i, I"
91 //
92 void Test4060154(/* char* par */);
93
94 // @bug 4062418
95 //
96 // Secondary/Tertiary comparison incorrect in French Secondary
97 //
98 void Test4062418(/* char* par */);
99
100 // @bug 4065540
101 //
102 // Collator.compare() method broken if either string contains spaces
103 //
104 void Test4065540(/* char* par */);
105
106 // @bug 4066189
107 //
108 // Unicode characters need to be recursively decomposed to get the
109 // correct result. For example,
110 // u1EB1 -> \u0103 + \u0300 -> a + \u0306 + \u0300.
111 //
112 void Test4066189(/* char* par */);
113
114 // @bug 4066696
115 //
116 // French secondary collation checking at the end of compare iteration fails
117 //
118 void Test4066696(/* char* par */);
119
120
121 // @bug 4076676
122 //
123 // Bad canonicalization of same-class combining characters
124 //
125 void Test4076676(/* char* par */);
126
127
128 // @bug 4078588
129 //
130 // RuleBasedCollator breaks on "< a < bb" rule
131 //
132 void Test4078588(/* char* par */);
133
134 // @bug 4079231
135 //
136 // RuleBasedCollator.equals(null) throws NullPointerException
137 //
138 void Test4079231(/* char* par */);
139
140 // @bug 4081866
141 //
142 // Combining characters in different classes not reordered properly.
143 //
144 void Test4081866(/* char* par */);
145
146 // @bug 4087241
147 //
148 // string comparison errors in Scandinavian collators
149 //
150 void Test4087241(/* char* par */);
151
152 // @bug 4087243
153 //
154 // CollationKey takes ignorable strings into account when it shouldn't
155 //
156 void Test4087243(/* char* par */);
157
158 // @bug 4092260
159 //
160 // Mu/micro conflict
161 // Micro symbol and greek lowercase letter Mu should sort identically
162 //
163 void Test4092260(/* char* par */);
164
165 // @bug 4095316
166 //
167 void Test4095316(/* char* par */);
168
169 // @bug 4101940
170 //
171 void Test4101940(/* char* par */);
172
173 // @bug 4103436
174 //
175 // Collator.compare not handling spaces properly
176 //
177 void Test4103436(/* char* par */);
178
179 // @bug 4114076
180 //
181 // Collation not Unicode conformant with Hangul syllables
182 //
183 void Test4114076(/* char* par */);
184
185
186 // @bug 4114077
187 //
188 // Collation with decomposition off doesn't work for Europe
189 //
190 void Test4114077(/* char* par */);
191
192 // @bug 4124632
193 //
194 // Collator.getCollationKey was hanging on certain character sequences
195 //
196 void Test4124632(/* char* par */);
197
198 // @bug 4132736
199 //
200 // sort order of french words with multiple accents has errors
201 //
202 void Test4132736(/* char* par */);
203
204 // @bug 4133509
205 //
206 // The sorting using java.text.CollationKey is not in the exact order
207 //
208 void Test4133509(/* char* par */);
209
210 // @bug 4139572
211 //
212 // getCollationKey throws exception for spanish text
213 // Cannot reproduce this bug on 1.2, however it DOES fail on 1.1.6
214 //
215 void Test4139572(/* char* par */);
216
217 // @bug 4141640
218 //
219 // Support for Swedish gone in 1.1.6 (Can't create Swedish collator)
220 //
221 void Test4141640(/* char* par */);
222
223 // @bug 4146160
224 //
225 // RuleBasedCollator doesn't use getCollationElementIterator internally
226 //
227 void Test4146160(/* char* par */);
228
ccorneliusfceb3982014-04-16 12:27:14 -0700229 void Test4179216();
230
clairehob26ce3a2012-01-10 17:54:41 -0800231 // Ticket 7189
232 //
233 // nextSortKeyPart incorrect for EO_S1 collation
234 //
235 void TestT7189();
236
237 // Ticket 8624
238 //
239 // Tertiary value compression problem with case first option enabled
240 //
241 void TestCaseFirstCompression();
claireho50294ea2010-05-03 15:44:48 -0700242
ccorneliusfceb3982014-04-16 12:27:14 -0700243 void TestTrailingComment();
244 void TestBeforeWithTooStrongAfter();
245
Jean-Baptiste Querub13da9d2009-07-17 17:53:22 -0700246private:
247 //------------------------------------------------------------------------
248 // Internal utilities
249 //
250 void compareArray(Collator &c,
251 const UChar tests[][CollationRegressionTest::MAX_TOKEN_LEN],
252 int32_t testCount);
253
254 void assertEqual(CollationElementIterator &i1, CollationElementIterator &i2);
255
256
257 RuleBasedCollator *en_us;
258
clairehob26ce3a2012-01-10 17:54:41 -0800259 void caseFirstCompressionSub(Collator *col, UnicodeString opt);
Jean-Baptiste Querub13da9d2009-07-17 17:53:22 -0700260};
261
262#endif /* #if !UCONFIG_NO_COLLATION */
263
264#endif