1 // Copyright (C) 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 /********************************************************************
5 * Copyright (c) 1997-2008, International Business Machines Corporation and
6 * others. All Rights Reserved.
7 ********************************************************************/
10 * MajorTestLevel is the top level test class for everything in the directory "IntlWork".
13 #ifndef _INTLTESTCOLLATOR
14 #define _INTLTESTCOLLATOR
16 #include "unicode/utypes.h"
18 #if !UCONFIG_NO_COLLATION
21 #include "unicode/coll.h"
22 #include "unicode/coleitr.h"
25 class IntlTestCollator: public IntlTest {
26 void runIndexedTest(int32_t index, UBool exec, const char* &name, char* par = NULL );
34 // These two should probably go down in IntlTest
35 void doTest(Collator* col, const UChar *source, const UChar *target, Collator::EComparisonResult result);
37 void doTest(Collator* col, const UnicodeString &source, const UnicodeString &target, Collator::EComparisonResult result);
38 void doTestVariant(Collator* col, const UnicodeString &source, const UnicodeString &target, Collator::EComparisonResult result);
39 virtual void reportCResult( const UnicodeString &source, const UnicodeString &target,
40 CollationKey &sourceKey, CollationKey &targetKey,
41 Collator::EComparisonResult compareResult,
42 Collator::EComparisonResult keyResult,
43 Collator::EComparisonResult incResult,
44 Collator::EComparisonResult expectedResult );
46 static UnicodeString &prettify(const CollationKey &source, UnicodeString &target);
47 static UnicodeString &appendCompareResult(Collator::EComparisonResult result, UnicodeString &target);
48 void backAndForth(CollationElementIterator &iter);
50 * Return an integer array containing all of the collation orders
51 * returned by calls to next on the specified iterator
53 Order *getOrders(CollationElementIterator &iter, int32_t &orderLength);
54 UCollationResult compareUsingPartials(UCollator *coll, const UChar source[], int32_t sLen, const UChar target[], int32_t tLen, int32_t pieceSize, UErrorCode &status);
58 #endif /* #if !UCONFIG_NO_COLLATION */