2000-01-15 02:00:06 +00:00
|
|
|
/********************************************************************
|
|
|
|
* COPYRIGHT:
|
|
|
|
* Copyright (c) 1997-1999, International Business Machines Corporation and
|
|
|
|
* others. All Rights Reserved.
|
|
|
|
********************************************************************/
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Collation regression tests.
|
|
|
|
* (So we'll have no regrets later)
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _REGCOLL
|
|
|
|
#define _REGCOLL
|
|
|
|
|
|
|
|
#ifndef _UTYPES
|
1999-12-28 23:57:50 +00:00
|
|
|
#include "unicode/utypes.h"
|
1999-08-16 21:50:52 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _COLL
|
1999-12-28 23:57:50 +00:00
|
|
|
#include "unicode/coll.h"
|
1999-08-16 21:50:52 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _COLEITR
|
1999-12-28 23:57:50 +00:00
|
|
|
#include "unicode/coleitr.h"
|
1999-08-16 21:50:52 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _INTLTEST
|
|
|
|
#include "intltest.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _UNISTR
|
1999-12-28 23:57:50 +00:00
|
|
|
#include "unicode/unistr.h"
|
1999-08-16 21:50:52 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
class CollationRegressionTest: public IntlTest
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
enum EToken_Len { MAX_TOKEN_LEN = 128 };
|
|
|
|
|
|
|
|
CollationRegressionTest();
|
2000-04-18 17:58:18 +00:00
|
|
|
virtual ~CollationRegressionTest();
|
1999-08-16 21:50:52 +00:00
|
|
|
|
2000-08-14 21:42:36 +00:00
|
|
|
void runIndexedTest( int32_t index, UBool exec, const char* &name, char* par = NULL );
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
// @bug 4048446
|
|
|
|
//
|
|
|
|
// CollationElementIterator.reset() doesn't work
|
|
|
|
//
|
2000-08-23 19:11:16 +00:00
|
|
|
void Test4048446(/* char* par */);
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
// @bug 4051866
|
|
|
|
//
|
|
|
|
// Collator -> rules -> Collator round-trip broken for expanding characters
|
|
|
|
//
|
2000-08-23 19:11:16 +00:00
|
|
|
void Test4051866(/* char* par */);
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
// @bug 4053636
|
|
|
|
//
|
|
|
|
// Collator thinks "black-bird" == "black"
|
|
|
|
//
|
2000-08-23 19:11:16 +00:00
|
|
|
void Test4053636(/* char* par */);
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
// @bug 4054238
|
|
|
|
//
|
|
|
|
// CollationElementIterator will not work correctly if the associated
|
|
|
|
// Collator object's mode is changed
|
|
|
|
//
|
2000-08-23 19:11:16 +00:00
|
|
|
void Test4054238(/* char* par */);
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
// @bug 4054734
|
|
|
|
//
|
|
|
|
// Collator.IDENTICAL documented but not implemented
|
|
|
|
//
|
2000-08-23 19:11:16 +00:00
|
|
|
void Test4054734(/* char* par */);
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
// @bug 4054736
|
|
|
|
//
|
|
|
|
// Full Decomposition mode not implemented
|
|
|
|
//
|
2000-08-23 19:11:16 +00:00
|
|
|
void Test4054736(/* char* par */);
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
// @bug 4058613
|
|
|
|
//
|
|
|
|
// Collator.getInstance() causes an ArrayIndexOutofBoundsException for Korean
|
|
|
|
//
|
2000-08-23 19:11:16 +00:00
|
|
|
void Test4058613(/* char* par */);
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
// @bug 4059820
|
|
|
|
//
|
|
|
|
// RuleBasedCollator.getRules does not return the exact pattern as input
|
|
|
|
// for expanding character sequences
|
|
|
|
//
|
2000-08-23 19:11:16 +00:00
|
|
|
void Test4059820(/* char* par */);
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
// @bug 4060154
|
|
|
|
//
|
|
|
|
// MergeCollation::fixEntry broken for "& H < \u0131, \u0130, i, I"
|
|
|
|
//
|
2000-08-23 19:11:16 +00:00
|
|
|
void Test4060154(/* char* par */);
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
// @bug 4062418
|
|
|
|
//
|
|
|
|
// Secondary/Tertiary comparison incorrect in French Secondary
|
|
|
|
//
|
2000-08-23 19:11:16 +00:00
|
|
|
void Test4062418(/* char* par */);
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
// @bug 4065540
|
|
|
|
//
|
|
|
|
// Collator.compare() method broken if either string contains spaces
|
|
|
|
//
|
2000-08-23 19:11:16 +00:00
|
|
|
void Test4065540(/* char* par */);
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
// @bug 4066189
|
|
|
|
//
|
|
|
|
// Unicode characters need to be recursively decomposed to get the
|
|
|
|
// correct result. For example,
|
|
|
|
// u1EB1 -> \u0103 + \u0300 -> a + \u0306 + \u0300.
|
|
|
|
//
|
2000-08-23 19:11:16 +00:00
|
|
|
void Test4066189(/* char* par */);
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
// @bug 4066696
|
|
|
|
//
|
|
|
|
// French secondary collation checking at the end of compare iteration fails
|
|
|
|
//
|
2000-08-23 19:11:16 +00:00
|
|
|
void Test4066696(/* char* par */);
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
// @bug 4076676
|
|
|
|
//
|
|
|
|
// Bad canonicalization of same-class combining characters
|
|
|
|
//
|
2000-08-23 19:11:16 +00:00
|
|
|
void Test4076676(/* char* par */);
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
// @bug 4078588
|
|
|
|
//
|
|
|
|
// RuleBasedCollator breaks on "< a < bb" rule
|
|
|
|
//
|
2000-08-23 19:11:16 +00:00
|
|
|
void Test4078588(/* char* par */);
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
// @bug 4079231
|
|
|
|
//
|
|
|
|
// RuleBasedCollator.equals(null) throws NullPointerException
|
|
|
|
//
|
2000-08-23 19:11:16 +00:00
|
|
|
void Test4079231(/* char* par */);
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
// @bug 4081866
|
|
|
|
//
|
|
|
|
// Combining characters in different classes not reordered properly.
|
|
|
|
//
|
2000-08-23 19:11:16 +00:00
|
|
|
void Test4081866(/* char* par */);
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
// @bug 4087241
|
|
|
|
//
|
|
|
|
// string comparison errors in Scandinavian collators
|
|
|
|
//
|
2000-08-23 19:11:16 +00:00
|
|
|
void Test4087241(/* char* par */);
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
// @bug 4087243
|
|
|
|
//
|
|
|
|
// CollationKey takes ignorable strings into account when it shouldn't
|
|
|
|
//
|
2000-08-23 19:11:16 +00:00
|
|
|
void Test4087243(/* char* par */);
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
// @bug 4092260
|
|
|
|
//
|
|
|
|
// Mu/micro conflict
|
|
|
|
// Micro symbol and greek lowercase letter Mu should sort identically
|
|
|
|
//
|
2000-08-23 19:11:16 +00:00
|
|
|
void Test4092260(/* char* par */);
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
// @bug 4095316
|
|
|
|
//
|
2000-08-23 19:11:16 +00:00
|
|
|
void Test4095316(/* char* par */);
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
// @bug 4101940
|
|
|
|
//
|
2000-08-23 19:11:16 +00:00
|
|
|
void Test4101940(/* char* par */);
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
// @bug 4103436
|
|
|
|
//
|
|
|
|
// Collator.compare not handling spaces properly
|
|
|
|
//
|
2000-08-23 19:11:16 +00:00
|
|
|
void Test4103436(/* char* par */);
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
// @bug 4114076
|
|
|
|
//
|
|
|
|
// Collation not Unicode conformant with Hangul syllables
|
|
|
|
//
|
2000-08-23 19:11:16 +00:00
|
|
|
void Test4114076(/* char* par */);
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
// @bug 4114077
|
|
|
|
//
|
|
|
|
// Collation with decomposition off doesn't work for Europe
|
|
|
|
//
|
2000-08-23 19:11:16 +00:00
|
|
|
void Test4114077(/* char* par */);
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
// @bug 4124632
|
|
|
|
//
|
|
|
|
// Collator.getCollationKey was hanging on certain character sequences
|
|
|
|
//
|
2000-08-23 19:11:16 +00:00
|
|
|
void Test4124632(/* char* par */);
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
// @bug 4132736
|
|
|
|
//
|
|
|
|
// sort order of french words with multiple accents has errors
|
|
|
|
//
|
2000-08-23 19:11:16 +00:00
|
|
|
void Test4132736(/* char* par */);
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
// @bug 4133509
|
|
|
|
//
|
|
|
|
// The sorting using java.text.CollationKey is not in the exact order
|
|
|
|
//
|
2000-08-23 19:11:16 +00:00
|
|
|
void Test4133509(/* char* par */);
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
// @bug 4139572
|
|
|
|
//
|
|
|
|
// getCollationKey throws exception for spanish text
|
|
|
|
// Cannot reproduce this bug on 1.2, however it DOES fail on 1.1.6
|
|
|
|
//
|
2000-08-23 19:11:16 +00:00
|
|
|
void Test4139572(/* char* par */);
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
// @bug 4141640
|
|
|
|
//
|
|
|
|
// Support for Swedish gone in 1.1.6 (Can't create Swedish collator)
|
|
|
|
//
|
2000-08-23 19:11:16 +00:00
|
|
|
void Test4141640(/* char* par */);
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
// @bug 4146160
|
|
|
|
//
|
|
|
|
// RuleBasedCollator doesn't use getCollationElementIterator internally
|
|
|
|
//
|
2000-08-23 19:11:16 +00:00
|
|
|
void Test4146160(/* char* par */);
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
static const UnicodeString test1;
|
|
|
|
static const UnicodeString test2;
|
|
|
|
static const UnicodeString test3;
|
|
|
|
};
|
|
|
|
#endif
|