Lines Matching refs:coll
44 static char* U_EXPORT2 ucol_sortKeyToString(const UCollator *coll, const uint8_t *sortkey, char *bu… in ucol_sortKeyToString() argument
45 (void)coll; // suppress compiler warnings about unused variable in ucol_sortKeyToString()
97 UCollator *coll = ucol_open(NULL, &status); in TestGetSetAttr() local
117 if (coll == NULL) { in TestGetSetAttr()
123 ucol_setAttribute(coll, currAttr, UCOL_DEFAULT, &status); in TestGetSetAttr()
128 value = ucol_getAttribute(coll, currAttr, &status); in TestGetSetAttr()
134 ucol_setAttribute(coll, currAttr, attrs[i].val[j], &status); in TestGetSetAttr()
141 ucol_setAttribute(coll, currAttr, attrs[i].nonValue, &status); in TestGetSetAttr()
148 ucol_setAttribute(coll, currAttr, value, &status); in TestGetSetAttr()
155 value = ucol_getAttribute(coll, UCOL_ATTRIBUTE_COUNT, &status); in TestGetSetAttr()
160 ucol_setAttribute(coll, UCOL_ATTRIBUTE_COUNT, UCOL_DEFAULT, &status); in TestGetSetAttr()
165 ucol_close(coll); in TestGetSetAttr()
178 static void doStrcoll(const UCollator* coll, const UChar* src, int32_t srcLen, const UChar* tgt, in… in doStrcoll() argument
185 if (ucol_strcoll(coll, src, srcLen, tgt, tgtLen) != expected) { in doStrcoll()
206 if (ucol_strcollUTF8(coll, srcU8, srcU8Len, tgtU8, tgtU8Len, &err) != expected in doStrcoll()
217 UCollator *coll=NULL;
229 coll = ucol_openRules(defaultRulesArray, size, UCOL_ON, UCOL_PRIMARY, &status);
230 if(U_SUCCESS(status) && coll !=NULL) {
231 binColData = (uint8_t*)ucol_cloneRuleData(coll, &len1, &status);
263 ucol_close(coll);
1406 UCollator *coll = NULL; in TestGetLocale() local
1425 coll = ucol_open(testStruct[i].requestedLocale, &status); in TestGetLocale()
1428 ucol_close(coll); in TestGetLocale()
1435 locale = ucol_getLocaleByType(coll, ULOC_REQUESTED_LOCALE, &status); in TestGetLocale()
1441 locale = ucol_getLocaleByType(coll, ULOC_VALID_LOCALE, &status); in TestGetLocale()
1445 locale = ucol_getLocaleByType(coll, ULOC_ACTUAL_LOCALE, &status); in TestGetLocale()
1449 ucol_close(coll); in TestGetLocale()
1455 coll = ucol_open("blahaha", &status); in TestGetLocale()
1461 const char *name = ucol_getLocaleByType(coll, ULOC_VALID_LOCALE, &status); in TestGetLocale()
1465 name = ucol_getLocaleByType(coll, ULOC_ACTUAL_LOCALE, &status); in TestGetLocale()
1469 ucol_close(coll); in TestGetLocale()
1479 coll = ucol_openRules(rlz, rlzLen, UCOL_DEFAULT, UCOL_DEFAULT, NULL, &status); in TestGetLocale()
1480 if (coll != NULL) { in TestGetLocale()
1481 locale = ucol_getLocaleByType(coll, ULOC_REQUESTED_LOCALE, &status); in TestGetLocale()
1486 locale = ucol_getLocaleByType(coll, ULOC_VALID_LOCALE, &status); in TestGetLocale()
1490 locale = ucol_getLocaleByType(coll, ULOC_ACTUAL_LOCALE, &status); in TestGetLocale()
1494 ucol_close(coll); in TestGetLocale()
1531 UCollator *coll = ucol_open("sh", &status); in TestBounds() local
1613 if(U_SUCCESS(status) && coll) { in TestBounds()
1616 skSize = ucol_getSortKey(coll, buffer, buffSize, tests[i].key, 512); in TestBounds()
1664 skSize = ucol_getSortKey(coll, buffer, buffSize, sortkey, 512); in TestBounds()
1669 skSize = ucol_getSortKey(coll, buffer, buffSize, sortkey, 512); in TestBounds()
1678 ucol_close(coll); in TestBounds()
1685 static void doOverrunTest(UCollator *coll, const UChar *uString, int32_t strLen) { in doOverrunTest() argument
1691 skLen = ucol_getSortKey(coll, uString, strLen, NULL, 0); in doOverrunTest()
1695 skLen2 = ucol_getSortKey(coll, uString, strLen, sortKey, i); in doOverrunTest()
1717 UCollator *coll = ucol_open("root", &status); in TestSortKeyBufferOverrun() local
1722 ucol_setAttribute(coll, UCOL_ALTERNATE_HANDLING, UCOL_NON_IGNORABLE, &status); in TestSortKeyBufferOverrun()
1723 doOverrunTest(coll, uString, strLen); in TestSortKeyBufferOverrun()
1726 ucol_setAttribute(coll, UCOL_ALTERNATE_HANDLING, UCOL_SHIFTED, &status); in TestSortKeyBufferOverrun()
1727 doOverrunTest(coll, uString, strLen); in TestSortKeyBufferOverrun()
1730 ucol_setAttribute(coll, UCOL_STRENGTH, UCOL_QUATERNARY, &status); in TestSortKeyBufferOverrun()
1731 doOverrunTest(coll, uString, strLen); in TestSortKeyBufferOverrun()
1734 ucol_setAttribute(coll, UCOL_FRENCH_COLLATION, UCOL_ON, &status); in TestSortKeyBufferOverrun()
1735 ucol_setAttribute(coll, UCOL_STRENGTH, UCOL_TERTIARY, &status); in TestSortKeyBufferOverrun()
1736 ucol_setAttribute(coll, UCOL_ALTERNATE_HANDLING, UCOL_NON_IGNORABLE, &status); in TestSortKeyBufferOverrun()
1737 doOverrunTest(coll, uString, strLen); in TestSortKeyBufferOverrun()
1740 ucol_close(coll); in TestSortKeyBufferOverrun()
1746 UCollator *coll = ucol_open(NULL, &error); in TestAttribute() local
1753 ucol_setAttribute(coll, UCOL_FRENCH_COLLATION, UCOL_OFF, &error); in TestAttribute()
1754 if (ucol_getAttribute(coll, UCOL_FRENCH_COLLATION, &error) != UCOL_OFF || in TestAttribute()
1759 ucol_setAttribute(coll, UCOL_FRENCH_COLLATION, UCOL_ON, &error); in TestAttribute()
1760 if (ucol_getAttribute(coll, UCOL_FRENCH_COLLATION, &error) != UCOL_ON || in TestAttribute()
1765 ucol_setAttribute(coll, UCOL_ALTERNATE_HANDLING, UCOL_SHIFTED, &error); in TestAttribute()
1766 if (ucol_getAttribute(coll, UCOL_ALTERNATE_HANDLING, &error) != UCOL_SHIFTED || in TestAttribute()
1771 ucol_setAttribute(coll, UCOL_ALTERNATE_HANDLING, UCOL_NON_IGNORABLE, &error); in TestAttribute()
1772 if (ucol_getAttribute(coll, UCOL_ALTERNATE_HANDLING, &error) != UCOL_NON_IGNORABLE || in TestAttribute()
1777 ucol_setAttribute(coll, UCOL_CASE_FIRST, UCOL_LOWER_FIRST, &error); in TestAttribute()
1778 if (ucol_getAttribute(coll, UCOL_CASE_FIRST, &error) != UCOL_LOWER_FIRST || in TestAttribute()
1783 ucol_setAttribute(coll, UCOL_CASE_FIRST, UCOL_UPPER_FIRST, &error); in TestAttribute()
1784 if (ucol_getAttribute(coll, UCOL_CASE_FIRST, &error) != UCOL_UPPER_FIRST || in TestAttribute()
1789 ucol_setAttribute(coll, UCOL_CASE_LEVEL, UCOL_ON, &error); in TestAttribute()
1790 if (ucol_getAttribute(coll, UCOL_CASE_LEVEL, &error) != UCOL_ON || in TestAttribute()
1795 ucol_setAttribute(coll, UCOL_CASE_LEVEL, UCOL_OFF, &error); in TestAttribute()
1796 if (ucol_getAttribute(coll, UCOL_CASE_LEVEL, &error) != UCOL_OFF || in TestAttribute()
1801 ucol_setAttribute(coll, UCOL_NORMALIZATION_MODE, UCOL_ON, &error); in TestAttribute()
1802 if (ucol_getAttribute(coll, UCOL_NORMALIZATION_MODE, &error) != UCOL_ON || in TestAttribute()
1807 ucol_setAttribute(coll, UCOL_NORMALIZATION_MODE, UCOL_OFF, &error); in TestAttribute()
1808 if (ucol_getAttribute(coll, UCOL_NORMALIZATION_MODE, &error) != UCOL_OFF || in TestAttribute()
1813 ucol_setAttribute(coll, UCOL_STRENGTH, UCOL_PRIMARY, &error); in TestAttribute()
1814 if (ucol_getAttribute(coll, UCOL_STRENGTH, &error) != UCOL_PRIMARY || in TestAttribute()
1819 ucol_setAttribute(coll, UCOL_STRENGTH, UCOL_SECONDARY, &error); in TestAttribute()
1820 if (ucol_getAttribute(coll, UCOL_STRENGTH, &error) != UCOL_SECONDARY || in TestAttribute()
1825 ucol_setAttribute(coll, UCOL_STRENGTH, UCOL_TERTIARY, &error); in TestAttribute()
1826 if (ucol_getAttribute(coll, UCOL_STRENGTH, &error) != UCOL_TERTIARY || in TestAttribute()
1831 ucol_setAttribute(coll, UCOL_STRENGTH, UCOL_QUATERNARY, &error); in TestAttribute()
1832 if (ucol_getAttribute(coll, UCOL_STRENGTH, &error) != UCOL_QUATERNARY || in TestAttribute()
1837 ucol_setAttribute(coll, UCOL_STRENGTH, UCOL_IDENTICAL, &error); in TestAttribute()
1838 if (ucol_getAttribute(coll, UCOL_STRENGTH, &error) != UCOL_IDENTICAL || in TestAttribute()
1843 ucol_close(coll); in TestAttribute()
1860 UCollator *coll = NULL; in TestGetTailoredSet() local
1867 coll = ucol_openRules(buff, buffLen, UCOL_DEFAULT, UCOL_DEFAULT, &pError, &status); in TestGetTailoredSet()
1869 set = ucol_getTailoredSet(coll, &status); in TestGetTailoredSet()
1883 ucol_close(coll); in TestGetTailoredSet()
1902 UCollator *coll = ucol_open("en", &status); in TestMergeSortKeys() local
1936 prefixKeyLen = ucol_getSortKey(coll, buffer, unescapedLen, prefixKey, 256); in TestMergeSortKeys()
1939 suffixKeyLen = ucol_getSortKey(coll, buffer, unescapedLen, suffixKey, 256); in TestMergeSortKeys()
1945 ucol_setAttribute(coll, UCOL_STRENGTH, strength, &status); in TestMergeSortKeys()
1948 sortKeysLen[i] = ucol_getSortKey(coll, buffer, unescapedLen, sortkeys[i], 256); in TestMergeSortKeys()
1955 ucol_sortKeyToString(coll, mergedPrefixkeys[i-1], outBuff1, l1), in TestMergeSortKeys()
1956 ucol_sortKeyToString(coll, mergedPrefixkeys[i], outBuff2, l2)); in TestMergeSortKeys()
1961 ucol_sortKeyToString(coll, mergedSuffixkeys[i-1], outBuff1, l1), in TestMergeSortKeys()
1962 ucol_sortKeyToString(coll, mergedSuffixkeys[i], outBuff2, l2)); in TestMergeSortKeys()
1989 emptyKeyLen = ucol_getSortKey(coll, &empty, 0, emptyKey, 20); in TestMergeSortKeys()
1991 abcKeyLen = ucol_getSortKey(coll, buffer, unescapedLen, abcKey, 50); in TestMergeSortKeys()
2017 ucol_close(coll); in TestMergeSortKeys()
2064 UCollator *coll = NULL, *fromNormalized = NULL; in TestShortString() local
2079 coll = ucol_openFromShortString(testCases[i].input, FALSE, &parseError, &status); in TestShortString()
2087 ucol_getShortDefinitionString(coll, locale, fromShortBuffer, 256, &status); in TestShortString()
2104 if(!ucol_equals(coll, fromNormalized)) { in TestShortString()
2110 ucol_close(coll); in TestShortString()
2217 UCollator *coll = NULL; in TestGetContractionsAndUnsafes() local
2229 coll = ucol_open(tests[i].locale, &status); in TestGetContractionsAndUnsafes()
2230 if (coll == NULL || U_FAILURE(status)) { in TestGetContractionsAndUnsafes()
2234 ucol_getContractionsAndExpansions(coll, conts, exp, TRUE, &status); in TestGetContractionsAndUnsafes()
2252 noConts = ucol_getUnsafeSet(coll, conts, &status); in TestGetContractionsAndUnsafes()
2263 ucol_close(coll); in TestGetContractionsAndUnsafes()
2305 UCollator *coll = ucol_openRules(uRules, uRulesLen, UCOL_DEFAULT, UCOL_DEFAULT, NULL, &status); in TestOpenBinary() local
2315 if((coll==NULL)||(U_FAILURE(status))) { in TestOpenBinary()
2326 imageSize = ucol_cloneBinary(coll, image, imageBufferCapacity, &status); in TestOpenBinary()
2330 imageSize = ucol_cloneBinary(coll, imageBuffer, imageSize, &status); in TestOpenBinary()
2342 genericOrderingTest(coll, wUCA, UPRV_LENGTHOF(wUCA)); in TestOpenBinary()
2352 ucol_close(coll); in TestOpenBinary()
2361 UCollator *coll = ucol_open("es@collation=pinyin", &status); in TestDefault() local
2362 if (coll == NULL || status == U_FILE_ACCESS_ERROR) { in TestDefault()
2370 ucol_close(coll); in TestDefault()
2386 UCollator *coll = ucol_open(loc, &status); in TestDefaultKeyword() local
2395 ucol_close(coll); in TestDefaultKeyword()
2468 UCollator *coll; in TestStrcollNull() local
2482 coll = ucol_open(NULL, &status); in TestStrcollNull()
2489 if (ucol_strcoll(coll, NULL, 0, NULL, 0) != 0) { in TestStrcollNull()
2493 if (ucol_strcoll(coll, NULL, -1, NULL, 0) != 0) { in TestStrcollNull()
2498 if (ucol_strcoll(coll, u16asc, -1, NULL, 10) != 0) { in TestStrcollNull()
2503 if (ucol_strcoll(coll, u16asc, -1, NULL, 0) <= 0) { in TestStrcollNull()
2506 if (ucol_strcoll(coll, NULL, 0, u16asc, -1) >= 0) { in TestStrcollNull()
2509 if (ucol_strcoll(coll, u16asc, u16ascLen, NULL, 0) <= 0) { in TestStrcollNull()
2513 if (ucol_strcoll(coll, u16han, -1, NULL, 0) <= 0) { in TestStrcollNull()
2516 if (ucol_strcoll(coll, NULL, 0, u16han, -1) >= 0) { in TestStrcollNull()
2519 if (ucol_strcoll(coll, NULL, 0, u16han, u16hanLen) >= 0) { in TestStrcollNull()
2525 if (ucol_strcollUTF8(coll, NULL, 0, NULL, 0, &status) != 0 || U_FAILURE(status)) { in TestStrcollNull()
2529 ucol_strcollUTF8(coll, NULL, -1, NULL, 0, &status); in TestStrcollNull()
2534 ucol_strcollUTF8(coll, u8asc, u8ascLen, NULL, 10, &status); in TestStrcollNull()
2540 if (ucol_strcollUTF8(coll, u8asc, -1, NULL, 0, &status) <= 0 || U_FAILURE(status)) { in TestStrcollNull()
2544 if (ucol_strcollUTF8(coll, NULL, 0, u8asc, -1, &status) >= 0 || U_FAILURE(status)) { in TestStrcollNull()
2548 if (ucol_strcollUTF8(coll, u8asc, u8ascLen, NULL, 0, &status) <= 0 || U_FAILURE(status)) { in TestStrcollNull()
2553 if (ucol_strcollUTF8(coll, u8han, -1, NULL, 0, &status) <= 0 || U_FAILURE(status)) { in TestStrcollNull()
2557 if (ucol_strcollUTF8(coll, NULL, 0, u8han, -1, &status) >= 0 || U_FAILURE(status)) { in TestStrcollNull()
2561 if (ucol_strcollUTF8(coll, NULL, 0, u8han, u8hanLen, &status) >= 0 || U_FAILURE(status)) { in TestStrcollNull()
2565 ucol_close(coll); in TestStrcollNull()