]>
git.saurik.com Git - apple/icu.git/blob - icuSources/test/intltest/itercoll.h
1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 /********************************************************************
5 * Copyright (c) 1997-2001, International Business Machines Corporation and
6 * others. All Rights Reserved.
7 ********************************************************************/
10 * Collation Iterator tests.
11 * (Let me reiterate my position...)
17 #include "unicode/utypes.h"
19 #if !UCONFIG_NO_COLLATION
21 #include "unicode/tblcoll.h"
22 #include "unicode/coleitr.h"
25 class CollationIteratorTest
: public IntlTestCollator
29 // If this is too small for the test data, just increase it.
30 // Just don't make it too large, otherwise the executable will get too big
31 enum EToken_Len
{ MAX_TOKEN_LEN
= 16 };
33 CollationIteratorTest();
34 virtual ~CollationIteratorTest();
36 void runIndexedTest(int32_t index
, UBool exec
, const char* &name
, char* par
= NULL
);
39 * Test that results from CollationElementIterator.next is equivalent to
40 * the reversed results from CollationElementIterator.previous, for the set
43 void TestUnicodeChar();
46 * Test for CollationElementIterator.previous()
48 * @bug 4108758 - Make sure it works with contracting characters
51 void TestPrevious(/* char* par */);
54 * Test for getOffset() and setOffset()
56 void TestOffset(/* char* par */);
61 void TestSetText(/* char* par */);
64 * Test for getMaxExpansion()
66 void TestMaxExpansion(/* char* par */);
71 void TestClearBuffers(/* char* par */);
74 * Testing the assignment operator
76 void TestAssignment();
79 * Testing the constructors
81 void TestConstructors();
84 * Testing the strength order functionality
86 void TestStrengthOrder();
88 //------------------------------------------------------------------------
94 struct ExpansionRecord
101 * Verify that getMaxExpansion works on a given set of collation rules
103 void verifyExpansion(UnicodeString rules
, ExpansionRecord tests
[], int32_t testCount
);
106 * Return a string containing all of the collation orders
107 * returned by calls to next on the specified iterator
109 UnicodeString
&orderString(CollationElementIterator
&iter
, UnicodeString
&target
);
111 void assertEqual(CollationElementIterator
&i1
, CollationElementIterator
&i2
);
113 RuleBasedCollator
*en_us
;
114 const UnicodeString test1
;
115 const UnicodeString test2
;
119 #endif /* #if !UCONFIG_NO_COLLATION */