]>
git.saurik.com Git - apple/icu.git/blob - icuSources/test/intltest/apicoll.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-2014, International Business Machines Corporation
6 * and others. All Rights Reserved.
7 ***********************************************************************/
10 * CollationAPITest is a third level test class. This test performs API
11 * related tests for the Collation framework.
17 #include "unicode/utypes.h"
19 #if !UCONFIG_NO_COLLATION
21 #include "unicode/tblcoll.h"
24 class CollationAPITest
: public IntlTestCollator
{
26 void runIndexedTest( int32_t index
, UBool exec
, const char* &name
, char* /*par = NULL */);
27 void doAssert(UBool condition
, const char *message
);
30 * This tests the properties of a collator object.
31 * - constructor/destructor
32 * - factory method createInstance
33 * - compare and getCollationKey
34 * - get/set decomposition mode and comparison level
35 * - displayable name in the desired locale
37 void TestProperty(/* char* par */);
38 void TestKeywordValues();
41 * This tests the RuleBasedCollator
42 * - constructor/destructor
45 void TestRuleBasedColl(/* char* par */);
48 * This tests the RuleBasedCollator
51 void TestRules(/* char* par */);
54 * Tests decomposition setting
56 void TestDecomposition();
64 * This tests the properties of a rule based collator object.
65 * - constructor/destructor
66 * - == and != operators
68 * - collation rules access
70 void TestOperators(/* char* par */);
73 * This tests the duplication of a collator object.
75 void TestDuplicate(/* char* par */);
78 * This tests the comparison convenience methods of a collator object.
80 * - greater than or equal to
83 void TestCompare(/* char* par */);
86 * This tests the hashCode method of a collator object.
88 void TestHashCode(/* char* par */);
91 * This tests the collation key related APIs.
92 * - constructor/destructor
93 * - Collator::getCollationKey
94 * - == and != operators
95 * - comparison between collation keys
96 * - creating collation key with a byte array and vice versa
98 void TestCollationKey(/* char* par */);
101 * This tests the CollationElementIterator related APIs.
102 * - creation of a CollationElementIterator object
103 * - == and != operators
104 * - iterating forward
105 * - reseting the iterator index
106 * - requesting the order properties(primary, secondary or tertiary)
108 void TestElemIter(/* char* par */);
111 * This tests the list the all available locales.
113 void TestGetAll(/* char* par */);
116 * This tests the sort keys generated by collator
119 void TestSortKeyOverflow();
122 * This tests getMaxExpansion
124 void TestMaxExpansion();
127 * Tests the retrieval of names given a locale
129 void TestDisplayName();
132 * Tests the collator attributes
134 void TestAttribute();
137 * Tests the setters and getters of variable top
139 void TestVariableTopSetting();
140 void TestMaxVariable();
143 * Tests GetLocale for a Collator
145 void TestGetLocale();
153 * Tests getTailoredSet API
155 void TestGetTailoredSet();
158 * Tests the subclassability
163 * Tests the dynamic and static ids of collation classes
170 void TestNULLCharTailoring();
173 void TestCloneBinary();
174 void TestIterNumeric();
175 void TestBadKeywords();
176 void TestGapTooSmall();
179 // If this is too small for the test data, just increase it.
180 // Just don't make it too large, otherwise the executable will get too big
181 enum EToken_Len
{ MAX_TOKEN_LEN
= 16 };
183 void dump(UnicodeString msg
, RuleBasedCollator
* c
, UErrorCode
& status
);
187 #endif /* #if !UCONFIG_NO_COLLATION */