• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 /********************************************************************
4  * Copyright (c) 1997-2013 International Business Machines
5  * Corporation and others. All Rights Reserved.
6  ********************************************************************/
7 /********************************************************************************
8 *
9 * File CAPITEST.H
10 *
11 * Modification History:
12 *        Name                     Description
13 *     Madhu Katragadda            Converted to C
14 *     Brian Rower                 Added TestOpenVsOpenRules
15 *********************************************************************************
16 *//* C API TEST For COLLATOR */
17 
18 #ifndef _CCOLLAPITST
19 #define _CCOLLAPITST
20 
21 #include "unicode/utypes.h"
22 
23 #if !UCONFIG_NO_COLLATION
24 
25 #include "cintltst.h"
26 #include "callcoll.h"
27 #define MAX_TOKEN_LEN 16
28 
29 
30     /**
31      * error reporting utility method
32      **/
33 
34     static void doAssert(int condition, const char *message);
35     /**
36      * Collator Class Properties
37      * ctor, dtor, createInstance, compare, getStrength/setStrength
38      * getDecomposition/setDecomposition, getDisplayName
39      */
40     void TestProperty(void);
41     /**
42      * Test RuleBasedCollator and getRules
43      **/
44     void TestRuleBasedColl(void);
45 
46     /**
47      * Test compare
48      **/
49     void TestCompare(void);
50     /**
51      * Test hashCode functionality
52      **/
53     void TestHashCode(void);
54     /**
55      * Tests the constructor and numerous other methods for CollationKey
56      **/
57    void TestSortKey(void);
58     /**
59      * test the CollationElementIterator methods
60      **/
61    void TestElemIter(void);
62     /**
63      * Test ucol_getAvailable and ucol_countAvailable()
64      **/
65     void TestGetAll(void);
66     /**
67      * Test ucol_GetDefaultRules ()
68     void TestGetDefaultRules(void);
69      **/
70 
71     void TestDecomposition(void);
72     /**
73      * Test ucol_safeClone ()
74      **/
75     void TestSafeClone(void);
76 
77     /**
78      * Test ucol_clone ()
79      **/
80     void TestClone(void);
81 
82     /**
83      * Test ucol_cloneBinary(), ucol_openBinary()
84      **/
85     void TestCloneBinary(void);
86 
87     /**
88      * Test ucol_open() vs. ucol_openRules()
89      **/
90     void TestOpenVsOpenRules(void);
91 
92     /**
93      * Test getting bounds for a sortkey
94      */
95     void TestBounds(void);
96 
97     /**
98      * Test ucol_getLocale function
99      */
100     void TestGetLocale(void);
101 
102     /**
103      * Test buffer overrun while having smaller buffer for sortkey (j1865)
104      */
105     void TestSortKeyBufferOverrun(void);
106     /**
107      * Test getting and setting of attributes
108      */
109     void TestGetSetAttr(void);
110     /**
111      * Test getTailoredSet
112      */
113     void TestGetTailoredSet(void);
114 
115     /**
116      * Test mergeSortKeys
117      */
118     void TestMergeSortKeys(void);
119 
120     /**
121      * test short string and collator identifier functions
122      */
123     static void TestShortString(void);
124 
125     /**
126      * test getContractions and getUnsafeSet
127      */
128     static void TestGetContractionsAndUnsafes(void);
129 
130     /**
131      * Test funny stuff with open binary
132      */
133     static void TestOpenBinary(void);
134 
135     /**
136      * Test getKeywordValuesForLocale API
137      */
138     static void TestGetKeywordValuesForLocale(void);
139 
140     /**
141      * test strcoll with null arg
142      */
143     static void TestStrcollNull(void);
144 
145     /**
146      * Simple test for ICU-21460.  The issue affects all components, but was originally reported against collation.
147      */
148     static void TestLocaleIDWithUnderscoreAndExtension(void);
149 
150 #endif /* #if !UCONFIG_NO_COLLATION */
151 
152 #endif
153