1 /********************************************************************
3 * Copyright (c) 1997-2003, International Business Machines Corporation and
4 * others. All Rights Reserved.
5 ********************************************************************/
8 * MajorTestLevel is the top level test class for everything in the directory "IntlWork".
11 #ifndef _INTLTESTCOLLATOR
12 #define _INTLTESTCOLLATOR
14 #include "unicode/utypes.h"
16 #if !UCONFIG_NO_COLLATION
19 #include "unicode/coll.h"
20 #include "unicode/coleitr.h"
23 class IntlTestCollator
: public IntlTest
{
24 void runIndexedTest(int32_t index
, UBool exec
, const char* &name
, char* par
= NULL
);
26 // These two should probably go down in IntlTest
27 void doTest(Collator
* col
, const UChar
*source
, const UChar
*target
, Collator::EComparisonResult result
);
29 void doTest(Collator
* col
, const UnicodeString
&source
, const UnicodeString
&target
, Collator::EComparisonResult result
);
30 void doTestVariant(Collator
* col
, const UnicodeString
&source
, const UnicodeString
&target
, Collator::EComparisonResult result
);
31 virtual void reportCResult( const UnicodeString
&source
, const UnicodeString
&target
,
32 CollationKey
&sourceKey
, CollationKey
&targetKey
,
33 Collator::EComparisonResult compareResult
,
34 Collator::EComparisonResult keyResult
,
35 Collator::EComparisonResult incResult
,
36 Collator::EComparisonResult expectedResult
);
38 static UnicodeString
&prettify(const CollationKey
&source
, UnicodeString
&target
);
39 static UnicodeString
&appendCompareResult(Collator::EComparisonResult result
, UnicodeString
&target
);
40 void backAndForth(CollationElementIterator
&iter
);
42 * Return an integer array containing all of the collation orders
43 * returned by calls to next on the specified iterator
45 int32_t *getOrders(CollationElementIterator
&iter
, int32_t &orderLength
);
46 UCollationResult
compareUsingPartials(UCollator
*coll
, const UChar source
[], int32_t sLen
, const UChar target
[], int32_t tLen
, int32_t pieceSize
, UErrorCode
&status
);
50 #endif /* #if !UCONFIG_NO_COLLATION */