]>
Commit | Line | Data |
---|---|---|
b75a7d8f A |
1 | /******************************************************************** |
2 | * COPYRIGHT: | |
46f4442e | 3 | * Copyright (c) 1997-2008, International Business Machines Corporation and |
b75a7d8f A |
4 | * others. All Rights Reserved. |
5 | ********************************************************************/ | |
6 | ||
7 | /** | |
8 | * MajorTestLevel is the top level test class for everything in the directory "IntlWork". | |
9 | */ | |
10 | ||
11 | #ifndef _INTLTESTCOLLATOR | |
12 | #define _INTLTESTCOLLATOR | |
13 | ||
14 | #include "unicode/utypes.h" | |
15 | ||
16 | #if !UCONFIG_NO_COLLATION | |
17 | ||
18 | #include "intltest.h" | |
19 | #include "unicode/coll.h" | |
b75a7d8f | 20 | #include "unicode/coleitr.h" |
b75a7d8f A |
21 | |
22 | ||
23 | class IntlTestCollator: public IntlTest { | |
24 | void runIndexedTest(int32_t index, UBool exec, const char* &name, char* par = NULL ); | |
25 | protected: | |
46f4442e A |
26 | struct Order |
27 | { | |
28 | int32_t order; | |
29 | int32_t offset; | |
30 | }; | |
31 | ||
b75a7d8f A |
32 | // These two should probably go down in IntlTest |
33 | void doTest(Collator* col, const UChar *source, const UChar *target, Collator::EComparisonResult result); | |
34 | ||
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 ); | |
43 | ||
44 | static UnicodeString &prettify(const CollationKey &source, UnicodeString &target); | |
45 | static UnicodeString &appendCompareResult(Collator::EComparisonResult result, UnicodeString &target); | |
46 | void backAndForth(CollationElementIterator &iter); | |
47 | /** | |
48 | * Return an integer array containing all of the collation orders | |
49 | * returned by calls to next on the specified iterator | |
50 | */ | |
46f4442e | 51 | Order *getOrders(CollationElementIterator &iter, int32_t &orderLength); |
b75a7d8f A |
52 | UCollationResult compareUsingPartials(UCollator *coll, const UChar source[], int32_t sLen, const UChar target[], int32_t tLen, int32_t pieceSize, UErrorCode &status); |
53 | ||
54 | }; | |
55 | ||
56 | #endif /* #if !UCONFIG_NO_COLLATION */ | |
57 | ||
58 | #endif |