Lines Matching refs:coll
44 static char* U_EXPORT2 ucol_sortKeyToString(const UCollator *coll, const uint8_t *sortkey, char *bu… in ucol_sortKeyToString() argument
96 UCollator *coll = ucol_open(NULL, &status); in TestGetSetAttr() local
116 if (coll == NULL) { in TestGetSetAttr()
122 ucol_setAttribute(coll, currAttr, UCOL_DEFAULT, &status); in TestGetSetAttr()
127 value = ucol_getAttribute(coll, currAttr, &status); in TestGetSetAttr()
133 ucol_setAttribute(coll, currAttr, attrs[i].val[j], &status); in TestGetSetAttr()
140 ucol_setAttribute(coll, currAttr, attrs[i].nonValue, &status); in TestGetSetAttr()
147 ucol_setAttribute(coll, currAttr, value, &status); in TestGetSetAttr()
154 value = ucol_getAttribute(coll, UCOL_ATTRIBUTE_COUNT, &status); in TestGetSetAttr()
159 ucol_setAttribute(coll, UCOL_ATTRIBUTE_COUNT, UCOL_DEFAULT, &status); in TestGetSetAttr()
164 ucol_close(coll); in TestGetSetAttr()
177 static void doStrcoll(const UCollator* coll, const UChar* src, int32_t srcLen, const UChar* tgt, in… in doStrcoll() argument
184 if (ucol_strcoll(coll, src, srcLen, tgt, tgtLen) != expected) { in doStrcoll()
205 if (ucol_strcollUTF8(coll, srcU8, srcU8Len, tgtU8, tgtU8Len, &err) != expected in doStrcoll()
216 UCollator *coll=NULL;
228 coll = ucol_openRules(defaultRulesArray, size, UCOL_ON, UCOL_PRIMARY, &status);
229 if(U_SUCCESS(status) && coll !=NULL) {
230 binColData = (uint8_t*)ucol_cloneRuleData(coll, &len1, &status);
262 ucol_close(coll);
1405 UCollator *coll = NULL; in TestGetLocale() local
1424 coll = ucol_open(testStruct[i].requestedLocale, &status); in TestGetLocale()
1427 ucol_close(coll); in TestGetLocale()
1434 locale = ucol_getLocaleByType(coll, ULOC_REQUESTED_LOCALE, &status); in TestGetLocale()
1440 locale = ucol_getLocaleByType(coll, ULOC_VALID_LOCALE, &status); in TestGetLocale()
1444 locale = ucol_getLocaleByType(coll, ULOC_ACTUAL_LOCALE, &status); in TestGetLocale()
1448 ucol_close(coll); in TestGetLocale()
1454 coll = ucol_open("blahaha", &status); in TestGetLocale()
1460 const char *name = ucol_getLocaleByType(coll, ULOC_VALID_LOCALE, &status); in TestGetLocale()
1464 name = ucol_getLocaleByType(coll, ULOC_ACTUAL_LOCALE, &status); in TestGetLocale()
1468 ucol_close(coll); in TestGetLocale()
1478 coll = ucol_openRules(rlz, rlzLen, UCOL_DEFAULT, UCOL_DEFAULT, NULL, &status); in TestGetLocale()
1479 if (coll != NULL) { in TestGetLocale()
1480 locale = ucol_getLocaleByType(coll, ULOC_REQUESTED_LOCALE, &status); in TestGetLocale()
1485 locale = ucol_getLocaleByType(coll, ULOC_VALID_LOCALE, &status); in TestGetLocale()
1489 locale = ucol_getLocaleByType(coll, ULOC_ACTUAL_LOCALE, &status); in TestGetLocale()
1493 ucol_close(coll); in TestGetLocale()
1530 UCollator *coll = ucol_open("sh", &status); in TestBounds() local
1612 if(U_SUCCESS(status) && coll) { in TestBounds()
1615 skSize = ucol_getSortKey(coll, buffer, buffSize, tests[i].key, 512); in TestBounds()
1663 skSize = ucol_getSortKey(coll, buffer, buffSize, sortkey, 512); in TestBounds()
1668 skSize = ucol_getSortKey(coll, buffer, buffSize, sortkey, 512); in TestBounds()
1677 ucol_close(coll); in TestBounds()
1684 static void doOverrunTest(UCollator *coll, const UChar *uString, int32_t strLen) { in doOverrunTest() argument
1690 skLen = ucol_getSortKey(coll, uString, strLen, NULL, 0); in doOverrunTest()
1694 skLen2 = ucol_getSortKey(coll, uString, strLen, sortKey, i); in doOverrunTest()
1716 UCollator *coll = ucol_open("root", &status); in TestSortKeyBufferOverrun() local
1721 ucol_setAttribute(coll, UCOL_ALTERNATE_HANDLING, UCOL_NON_IGNORABLE, &status); in TestSortKeyBufferOverrun()
1722 doOverrunTest(coll, uString, strLen); in TestSortKeyBufferOverrun()
1725 ucol_setAttribute(coll, UCOL_ALTERNATE_HANDLING, UCOL_SHIFTED, &status); in TestSortKeyBufferOverrun()
1726 doOverrunTest(coll, uString, strLen); in TestSortKeyBufferOverrun()
1729 ucol_setAttribute(coll, UCOL_STRENGTH, UCOL_QUATERNARY, &status); in TestSortKeyBufferOverrun()
1730 doOverrunTest(coll, uString, strLen); in TestSortKeyBufferOverrun()
1733 ucol_setAttribute(coll, UCOL_FRENCH_COLLATION, UCOL_ON, &status); in TestSortKeyBufferOverrun()
1734 ucol_setAttribute(coll, UCOL_STRENGTH, UCOL_TERTIARY, &status); in TestSortKeyBufferOverrun()
1735 ucol_setAttribute(coll, UCOL_ALTERNATE_HANDLING, UCOL_NON_IGNORABLE, &status); in TestSortKeyBufferOverrun()
1736 doOverrunTest(coll, uString, strLen); in TestSortKeyBufferOverrun()
1739 ucol_close(coll); in TestSortKeyBufferOverrun()
1745 UCollator *coll = ucol_open(NULL, &error); in TestAttribute() local
1752 ucol_setAttribute(coll, UCOL_FRENCH_COLLATION, UCOL_OFF, &error); in TestAttribute()
1753 if (ucol_getAttribute(coll, UCOL_FRENCH_COLLATION, &error) != UCOL_OFF || in TestAttribute()
1758 ucol_setAttribute(coll, UCOL_FRENCH_COLLATION, UCOL_ON, &error); in TestAttribute()
1759 if (ucol_getAttribute(coll, UCOL_FRENCH_COLLATION, &error) != UCOL_ON || in TestAttribute()
1764 ucol_setAttribute(coll, UCOL_ALTERNATE_HANDLING, UCOL_SHIFTED, &error); in TestAttribute()
1765 if (ucol_getAttribute(coll, UCOL_ALTERNATE_HANDLING, &error) != UCOL_SHIFTED || in TestAttribute()
1770 ucol_setAttribute(coll, UCOL_ALTERNATE_HANDLING, UCOL_NON_IGNORABLE, &error); in TestAttribute()
1771 if (ucol_getAttribute(coll, UCOL_ALTERNATE_HANDLING, &error) != UCOL_NON_IGNORABLE || in TestAttribute()
1776 ucol_setAttribute(coll, UCOL_CASE_FIRST, UCOL_LOWER_FIRST, &error); in TestAttribute()
1777 if (ucol_getAttribute(coll, UCOL_CASE_FIRST, &error) != UCOL_LOWER_FIRST || in TestAttribute()
1782 ucol_setAttribute(coll, UCOL_CASE_FIRST, UCOL_UPPER_FIRST, &error); in TestAttribute()
1783 if (ucol_getAttribute(coll, UCOL_CASE_FIRST, &error) != UCOL_UPPER_FIRST || in TestAttribute()
1788 ucol_setAttribute(coll, UCOL_CASE_LEVEL, UCOL_ON, &error); in TestAttribute()
1789 if (ucol_getAttribute(coll, UCOL_CASE_LEVEL, &error) != UCOL_ON || in TestAttribute()
1794 ucol_setAttribute(coll, UCOL_CASE_LEVEL, UCOL_OFF, &error); in TestAttribute()
1795 if (ucol_getAttribute(coll, UCOL_CASE_LEVEL, &error) != UCOL_OFF || in TestAttribute()
1800 ucol_setAttribute(coll, UCOL_NORMALIZATION_MODE, UCOL_ON, &error); in TestAttribute()
1801 if (ucol_getAttribute(coll, UCOL_NORMALIZATION_MODE, &error) != UCOL_ON || in TestAttribute()
1806 ucol_setAttribute(coll, UCOL_NORMALIZATION_MODE, UCOL_OFF, &error); in TestAttribute()
1807 if (ucol_getAttribute(coll, UCOL_NORMALIZATION_MODE, &error) != UCOL_OFF || in TestAttribute()
1812 ucol_setAttribute(coll, UCOL_STRENGTH, UCOL_PRIMARY, &error); in TestAttribute()
1813 if (ucol_getAttribute(coll, UCOL_STRENGTH, &error) != UCOL_PRIMARY || in TestAttribute()
1818 ucol_setAttribute(coll, UCOL_STRENGTH, UCOL_SECONDARY, &error); in TestAttribute()
1819 if (ucol_getAttribute(coll, UCOL_STRENGTH, &error) != UCOL_SECONDARY || in TestAttribute()
1824 ucol_setAttribute(coll, UCOL_STRENGTH, UCOL_TERTIARY, &error); in TestAttribute()
1825 if (ucol_getAttribute(coll, UCOL_STRENGTH, &error) != UCOL_TERTIARY || in TestAttribute()
1830 ucol_setAttribute(coll, UCOL_STRENGTH, UCOL_QUATERNARY, &error); in TestAttribute()
1831 if (ucol_getAttribute(coll, UCOL_STRENGTH, &error) != UCOL_QUATERNARY || in TestAttribute()
1836 ucol_setAttribute(coll, UCOL_STRENGTH, UCOL_IDENTICAL, &error); in TestAttribute()
1837 if (ucol_getAttribute(coll, UCOL_STRENGTH, &error) != UCOL_IDENTICAL || in TestAttribute()
1842 ucol_close(coll); in TestAttribute()
1859 UCollator *coll = NULL; in TestGetTailoredSet() local
1866 coll = ucol_openRules(buff, buffLen, UCOL_DEFAULT, UCOL_DEFAULT, &pError, &status); in TestGetTailoredSet()
1868 set = ucol_getTailoredSet(coll, &status); in TestGetTailoredSet()
1882 ucol_close(coll); in TestGetTailoredSet()
1901 UCollator *coll = ucol_open("en", &status); in TestMergeSortKeys() local
1935 prefixKeyLen = ucol_getSortKey(coll, buffer, unescapedLen, prefixKey, 256); in TestMergeSortKeys()
1938 suffixKeyLen = ucol_getSortKey(coll, buffer, unescapedLen, suffixKey, 256); in TestMergeSortKeys()
1944 ucol_setAttribute(coll, UCOL_STRENGTH, strength, &status); in TestMergeSortKeys()
1947 sortKeysLen[i] = ucol_getSortKey(coll, buffer, unescapedLen, sortkeys[i], 256); in TestMergeSortKeys()
1954 ucol_sortKeyToString(coll, mergedPrefixkeys[i-1], outBuff1, l1), in TestMergeSortKeys()
1955 ucol_sortKeyToString(coll, mergedPrefixkeys[i], outBuff2, l2)); in TestMergeSortKeys()
1960 ucol_sortKeyToString(coll, mergedSuffixkeys[i-1], outBuff1, l1), in TestMergeSortKeys()
1961 ucol_sortKeyToString(coll, mergedSuffixkeys[i], outBuff2, l2)); in TestMergeSortKeys()
1988 emptyKeyLen = ucol_getSortKey(coll, &empty, 0, emptyKey, 20); in TestMergeSortKeys()
1990 abcKeyLen = ucol_getSortKey(coll, buffer, unescapedLen, abcKey, 50); in TestMergeSortKeys()
2016 ucol_close(coll); in TestMergeSortKeys()
2059 UCollator *coll = NULL, *fromNormalized = NULL; in TestShortString() local
2074 coll = ucol_openFromShortString(testCases[i].input, FALSE, &parseError, &status); in TestShortString()
2082 ucol_getShortDefinitionString(coll, locale, fromShortBuffer, 256, &status); in TestShortString()
2099 if(!ucol_equals(coll, fromNormalized)) { in TestShortString()
2105 ucol_close(coll); in TestShortString()
2212 UCollator *coll = NULL; in TestGetContractionsAndUnsafes() local
2224 coll = ucol_open(tests[i].locale, &status); in TestGetContractionsAndUnsafes()
2225 if (coll == NULL || U_FAILURE(status)) { in TestGetContractionsAndUnsafes()
2229 ucol_getContractionsAndExpansions(coll, conts, exp, TRUE, &status); in TestGetContractionsAndUnsafes()
2247 noConts = ucol_getUnsafeSet(coll, conts, &status); in TestGetContractionsAndUnsafes()
2258 ucol_close(coll); in TestGetContractionsAndUnsafes()
2300 UCollator *coll = ucol_openRules(uRules, uRulesLen, UCOL_DEFAULT, UCOL_DEFAULT, NULL, &status); in TestOpenBinary() local
2310 if((coll==NULL)||(U_FAILURE(status))) { in TestOpenBinary()
2321 imageSize = ucol_cloneBinary(coll, image, imageBufferCapacity, &status); in TestOpenBinary()
2325 imageSize = ucol_cloneBinary(coll, imageBuffer, imageSize, &status); in TestOpenBinary()
2337 genericOrderingTest(coll, wUCA, UPRV_LENGTHOF(wUCA)); in TestOpenBinary()
2347 ucol_close(coll); in TestOpenBinary()
2356 UCollator *coll = ucol_open("es@collation=pinyin", &status); in TestDefault() local
2357 if (coll == NULL || status == U_FILE_ACCESS_ERROR) { in TestDefault()
2365 ucol_close(coll); in TestDefault()
2381 UCollator *coll = ucol_open(loc, &status); in TestDefaultKeyword() local
2390 ucol_close(coll); in TestDefaultKeyword()
2463 UCollator *coll; in TestStrcollNull() local
2477 coll = ucol_open(NULL, &status); in TestStrcollNull()
2484 if (ucol_strcoll(coll, NULL, 0, NULL, 0) != 0) { in TestStrcollNull()
2488 if (ucol_strcoll(coll, NULL, -1, NULL, 0) != 0) { in TestStrcollNull()
2493 if (ucol_strcoll(coll, u16asc, -1, NULL, 10) != 0) { in TestStrcollNull()
2498 if (ucol_strcoll(coll, u16asc, -1, NULL, 0) <= 0) { in TestStrcollNull()
2501 if (ucol_strcoll(coll, NULL, 0, u16asc, -1) >= 0) { in TestStrcollNull()
2504 if (ucol_strcoll(coll, u16asc, u16ascLen, NULL, 0) <= 0) { in TestStrcollNull()
2508 if (ucol_strcoll(coll, u16han, -1, NULL, 0) <= 0) { in TestStrcollNull()
2511 if (ucol_strcoll(coll, NULL, 0, u16han, -1) >= 0) { in TestStrcollNull()
2514 if (ucol_strcoll(coll, NULL, 0, u16han, u16hanLen) >= 0) { in TestStrcollNull()
2520 if (ucol_strcollUTF8(coll, NULL, 0, NULL, 0, &status) != 0 || U_FAILURE(status)) { in TestStrcollNull()
2524 ucol_strcollUTF8(coll, NULL, -1, NULL, 0, &status); in TestStrcollNull()
2529 ucol_strcollUTF8(coll, u8asc, u8ascLen, NULL, 10, &status); in TestStrcollNull()
2535 if (ucol_strcollUTF8(coll, u8asc, -1, NULL, 0, &status) <= 0 || U_FAILURE(status)) { in TestStrcollNull()
2539 if (ucol_strcollUTF8(coll, NULL, 0, u8asc, -1, &status) >= 0 || U_FAILURE(status)) { in TestStrcollNull()
2543 if (ucol_strcollUTF8(coll, u8asc, u8ascLen, NULL, 0, &status) <= 0 || U_FAILURE(status)) { in TestStrcollNull()
2548 if (ucol_strcollUTF8(coll, u8han, -1, NULL, 0, &status) <= 0 || U_FAILURE(status)) { in TestStrcollNull()
2552 if (ucol_strcollUTF8(coll, NULL, 0, u8han, -1, &status) >= 0 || U_FAILURE(status)) { in TestStrcollNull()
2556 if (ucol_strcollUTF8(coll, NULL, 0, u8han, u8hanLen, &status) >= 0 || U_FAILURE(status)) { in TestStrcollNull()
2560 ucol_close(coll); in TestStrcollNull()