1 /********************************************************************
3 * Copyright (c) 1997-2008, 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
);
32 // These two should probably go down in IntlTest
33 void doTest(Collator
* col
, const UChar
*source
, const UChar
*target
, Collator::EComparisonResult result
);
35 void doTest(Collator
* col
, const UnicodeString
&source
, const UnicodeString
&target
, Collator::EComparisonResult result
);
36 void doTestVariant(Collator
* col
, const UnicodeString
&source
, const UnicodeString
&target
, Collator::EComparisonResult result
);
37 virtual void reportCResult( const UnicodeString
&source
, const UnicodeString
&target
,
38 CollationKey
&sourceKey
, CollationKey
&targetKey
,
39 Collator::EComparisonResult compareResult
,
40 Collator::EComparisonResult keyResult
,
41 Collator::EComparisonResult incResult
,
42 Collator::EComparisonResult expectedResult
);
44 static UnicodeString
&prettify(const CollationKey
&source
, UnicodeString
&target
);
45 static UnicodeString
&appendCompareResult(Collator::EComparisonResult result
, UnicodeString
&target
);
46 void backAndForth(CollationElementIterator
&iter
);
48 * Return an integer array containing all of the collation orders
49 * returned by calls to next on the specified iterator
51 Order
*getOrders(CollationElementIterator
&iter
, int32_t &orderLength
);
52 UCollationResult
compareUsingPartials(UCollator
*coll
, const UChar source
[], int32_t sLen
, const UChar target
[], int32_t tLen
, int32_t pieceSize
, UErrorCode
&status
);
56 #endif /* #if !UCONFIG_NO_COLLATION */