summaryrefslogtreecommitdiff
path: root/Build/source/libs/icu/icu-src/source/test/intltest/regcoll.h
blob: 510707126b397216166b3178a09f2b259bd6327b (plain)
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
/********************************************************************
 * COPYRIGHT: 
 * Copyright (c) 1997-2014, International Business Machines Corporation and
 * others. All Rights Reserved.
 ********************************************************************/

/**
 * Collation regression tests.
 * (So we'll have no regrets later)
 */

#ifndef _REGCOLL
#define _REGCOLL

#include "unicode/utypes.h"

#if !UCONFIG_NO_COLLATION

#include "unicode/coleitr.h"
#include "tscoll.h"

class CollationRegressionTest: public IntlTestCollator
{
public:

    // If this is too small for the test data, just increase it.
    // Just don't make it too large, otherwise the executable will get too big
    enum EToken_Len { MAX_TOKEN_LEN = 32 };

    CollationRegressionTest();
    virtual ~CollationRegressionTest();

    void runIndexedTest( int32_t index, UBool exec, const char* &name, char* par = NULL );

    // @bug 4048446
    //
    // CollationElementIterator.reset() doesn't work
    //
    void Test4048446(/* char* par */);

    // @bug 4051866
    //
    // Collator -> rules -> Collator round-trip broken for expanding characters
    //
    void Test4051866(/* char* par */);

    // @bug 4053636
    //
    // Collator thinks "black-bird" == "black"
    //
    void Test4053636(/* char* par */);


    // @bug 4054238
    //
    // CollationElementIterator will not work correctly if the associated
    // Collator object's mode is changed
    //
    void Test4054238(/* char* par */);

    // @bug 4054734
    //
    // Collator.IDENTICAL documented but not implemented
    //
    void Test4054734(/* char* par */);

    // @bug 4054736
    //
    // Full Decomposition mode not implemented
    //
    void Test4054736(/* char* par */);

    // @bug 4058613
    //
    // Collator.getInstance() causes an ArrayIndexOutofBoundsException for Korean  
    //
    void Test4058613(/* char* par */);
    
    // @bug 4059820
    //
    // RuleBasedCollator.getRules does not return the exact pattern as input
    // for expanding character sequences
    //
    void Test4059820(/* char* par */);

    // @bug 4060154
    //
    // MergeCollation::fixEntry broken for "& H < \u0131, \u0130, i, I"
    //
    void Test4060154(/* char* par */);

    // @bug 4062418
    //
    // Secondary/Tertiary comparison incorrect in French Secondary
    //
    void Test4062418(/* char* par */);

    // @bug 4065540
    //
    // Collator.compare() method broken if either string contains spaces
    //
    void Test4065540(/* char* par */);

    // @bug 4066189
    //
    // Unicode characters need to be recursively decomposed to get the
    // correct result. For example,
    // u1EB1 -> \u0103 + \u0300 -> a + \u0306 + \u0300.
    //
    void Test4066189(/* char* par */);

    // @bug 4066696
    //
    // French secondary collation checking at the end of compare iteration fails
    //
    void Test4066696(/* char* par */);


    // @bug 4076676
    //
    // Bad canonicalization of same-class combining characters
    //
    void Test4076676(/* char* par */);


    // @bug 4078588
    //
    // RuleBasedCollator breaks on "< a < bb" rule
    //
    void Test4078588(/* char* par */);

    // @bug 4079231
    //
    // RuleBasedCollator.equals(null) throws NullPointerException
    //
    void Test4079231(/* char* par */);

    // @bug 4081866
    //
    // Combining characters in different classes not reordered properly.
    //
    void Test4081866(/* char* par */);

    // @bug 4087241
    //
    // string comparison errors in Scandinavian collators
    //
    void Test4087241(/* char* par */);

    // @bug 4087243
    //
    // CollationKey takes ignorable strings into account when it shouldn't
    //
    void Test4087243(/* char* par */);

    // @bug 4092260
    //
    // Mu/micro conflict
    // Micro symbol and greek lowercase letter Mu should sort identically
    //
    void Test4092260(/* char* par */);

    // @bug 4095316
    //
    void Test4095316(/* char* par */);

    // @bug 4101940
    //
    void Test4101940(/* char* par */);

    // @bug 4103436
    //
    // Collator.compare not handling spaces properly
    //
    void Test4103436(/* char* par */);

    // @bug 4114076
    //
    // Collation not Unicode conformant with Hangul syllables
    //
    void Test4114076(/* char* par */);
    
    
    // @bug 4114077
    //
    // Collation with decomposition off doesn't work for Europe 
    //
    void Test4114077(/* char* par */);

    // @bug 4124632
    //
    // Collator.getCollationKey was hanging on certain character sequences
    //
    void Test4124632(/* char* par */);
    
    // @bug 4132736
    //
    // sort order of french words with multiple accents has errors
    //
    void Test4132736(/* char* par */);
    
    // @bug 4133509
    //
    // The sorting using java.text.CollationKey is not in the exact order
    //
    void Test4133509(/* char* par */);

    // @bug 4139572
    //
    // getCollationKey throws exception for spanish text 
    // Cannot reproduce this bug on 1.2, however it DOES fail on 1.1.6
    //
    void Test4139572(/* char* par */);
    
    // @bug 4141640
    //
    // Support for Swedish gone in 1.1.6 (Can't create Swedish collator) 
    //
    void Test4141640(/* char* par */);
    
    // @bug 4146160
    //
    // RuleBasedCollator doesn't use getCollationElementIterator internally
    //
    void Test4146160(/* char* par */);

    void Test4179216();

    // Ticket 7189
    //
    // nextSortKeyPart incorrect for EO_S1 collation
    //
    void TestT7189();

    // Ticket 8624
    //
    // Tertiary value compression problem with case first option enabled
    //
    void TestCaseFirstCompression();

    void TestTrailingComment();
    void TestBeforeWithTooStrongAfter();

private:
    //------------------------------------------------------------------------
    // Internal utilities
    //
    void compareArray(Collator &c,
                    const UChar tests[][CollationRegressionTest::MAX_TOKEN_LEN],
                    int32_t testCount);

    void assertEqual(CollationElementIterator &i1, CollationElementIterator &i2);


    RuleBasedCollator *en_us;

    void caseFirstCompressionSub(Collator *col, UnicodeString opt);
};

#endif /* #if !UCONFIG_NO_COLLATION */

#endif