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_cloneBinary(), ucol_openBinary() 79 **/ 80 void TestCloneBinary(void); 81 82 /** 83 * Test ucol_open() vs. ucol_openRules() 84 **/ 85 void TestOpenVsOpenRules(void); 86 87 /** 88 * Test getting bounds for a sortkey 89 */ 90 void TestBounds(void); 91 92 /** 93 * Test ucol_getLocale function 94 */ 95 void TestGetLocale(void); 96 97 /** 98 * Test buffer overrun while having smaller buffer for sortkey (j1865) 99 */ 100 void TestSortKeyBufferOverrun(void); 101 /** 102 * Test getting and setting of attributes 103 */ 104 void TestGetSetAttr(void); 105 /** 106 * Test getTailoredSet 107 */ 108 void TestGetTailoredSet(void); 109 110 /** 111 * Test mergeSortKeys 112 */ 113 void TestMergeSortKeys(void); 114 115 /** 116 * test short string and collator identifier functions 117 */ 118 static void TestShortString(void); 119 120 /** 121 * test getContractions and getUnsafeSet 122 */ 123 static void TestGetContractionsAndUnsafes(void); 124 125 /** 126 * Test funny stuff with open binary 127 */ 128 static void TestOpenBinary(void); 129 130 /** 131 * Test getKeywordValuesForLocale API 132 */ 133 static void TestGetKeywordValuesForLocale(void); 134 135 /** 136 * test strcoll with null arg 137 */ 138 static void TestStrcollNull(void); 139 140 #endif /* #if !UCONFIG_NO_COLLATION */ 141 142 #endif 143