Home | History | Annotate | Download | only in cintltst

Lines Matching refs:coll

44 static char* U_EXPORT2 ucol_sortKeyToString(const UCollator *coll, const uint8_t *sortkey, char *buffer, uint32_t len) {
96 UCollator *coll = ucol_open(NULL, &status);
116 if (coll == NULL) {
122 ucol_setAttribute(coll, currAttr, UCOL_DEFAULT, &status);
127 value = ucol_getAttribute(coll, currAttr, &status);
133 ucol_setAttribute(coll, currAttr, attrs[i].val[j], &status);
140 ucol_setAttribute(coll, currAttr, attrs[i].nonValue, &status);
147 ucol_setAttribute(coll, currAttr, value, &status);
154 value = ucol_getAttribute(coll, UCOL_ATTRIBUTE_COUNT, &status);
159 ucol_setAttribute(coll, UCOL_ATTRIBUTE_COUNT, UCOL_DEFAULT, &status);
164 ucol_close(coll);
177 static void doStrcoll(const UCollator* coll, const UChar* src, int32_t srcLen, const UChar* tgt, int32_t tgtLen,
184 if (ucol_strcoll(coll, src, srcLen, tgt, tgtLen) != expected) {
205 if (ucol_strcollUTF8(coll, srcU8, srcU8Len, tgtU8, tgtU8Len, &err) != expected
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);
1385 UCollator *coll = NULL;
1404 coll = ucol_open(testStruct[i].requestedLocale, &status);
1407 ucol_close(coll);
1414 locale = ucol_getLocaleByType(coll, ULOC_REQUESTED_LOCALE, &status);
1416 log_err("[Coll %s]: Error in requested locale, expected %s, got %s\n", testStruct[i].requestedLocale, testStruct[i].requestedLocale, locale);
1418 locale = ucol_getLocaleByType(coll, ULOC_VALID_LOCALE, &status);
1420 log_err("[Coll %s]: Error in valid locale, expected %s, got %s\n", testStruct[i].requestedLocale, testStruct[i].validLocale, locale);
1422 locale = ucol_getLocaleByType(coll, ULOC_ACTUAL_LOCALE, &status);
1424 log_err("[Coll %s]: Error in actual locale, expected %s, got %s\n", testStruct[i].requestedLocale, testStruct[i].actualLocale, locale);
1426 ucol_close(coll);
1432 coll = ucol_open("blahaha", &status);
1435 if(strcmp(ucol_getLocaleByType(coll, ULOC_REQUESTED_LOCALE, &status), "blahaha")) {
1438 if(strcmp(ucol_getLocaleByType(coll, ULOC_VALID_LOCALE, &status),
1443 if(strcmp(ucol_getLocaleByType(coll, ULOC_ACTUAL_LOCALE, &status),
1448 ucol_close(coll);
1458 coll = ucol_openRules(rlz, rlzLen, UCOL_DEFAULT, UCOL_DEFAULT, NULL, &status);
1459 locale = ucol_getLocaleByType(coll, ULOC_REQUESTED_LOCALE, &status);
1463 locale = ucol_getLocaleByType(coll, ULOC_VALID_LOCALE, &status);
1467 locale = ucol_getLocaleByType(coll, ULOC_ACTUAL_LOCALE, &status);
1471 ucol_close(coll);
1506 UCollator *coll = ucol_open("sh", &status);
1588 if(U_SUCCESS(status) && coll) {
1591 skSize = ucol_getSortKey(coll, buffer, buffSize, tests[i].key, 512);
1639 skSize = ucol_getSortKey(coll, buffer, buffSize, sortkey, 512);
1644 skSize = ucol_getSortKey(coll, buffer, buffSize, sortkey, 512);
1653 ucol_close(coll);
1660 static void doOverrunTest(UCollator *coll, const UChar *uString, int32_t strLen) {
1666 skLen = ucol_getSortKey(coll, uString, strLen, NULL, 0);
1670 skLen2 = ucol_getSortKey(coll, uString, strLen, sortKey, i);
1692 UCollator *coll = ucol_open("root", &status);
1697 ucol_setAttribute(coll, UCOL_ALTERNATE_HANDLING, UCOL_NON_IGNORABLE, &status);
1698 doOverrunTest(coll, uString, strLen);
1701 ucol_setAttribute(coll, UCOL_ALTERNATE_HANDLING, UCOL_SHIFTED, &status);
1702 doOverrunTest(coll, uString, strLen);
1705 ucol_setAttribute(coll, UCOL_STRENGTH, UCOL_QUATERNARY, &status);
1706 doOverrunTest(coll, uString, strLen);
1709 ucol_setAttribute(coll, UCOL_FRENCH_COLLATION, UCOL_ON, &status);
1710 ucol_setAttribute(coll, UCOL_STRENGTH, UCOL_TERTIARY, &status);
1711 ucol_setAttribute(coll, UCOL_ALTERNATE_HANDLING, UCOL_NON_IGNORABLE, &status);
1712 doOverrunTest(coll, uString, strLen);
1715 ucol_close(coll);
1721 UCollator *coll = ucol_open(NULL, &error);
1728 ucol_setAttribute(coll, UCOL_FRENCH_COLLATION, UCOL_OFF, &error);
1729 if (ucol_getAttribute(coll, UCOL_FRENCH_COLLATION, &error) != UCOL_OFF ||
1734 ucol_setAttribute(coll, UCOL_FRENCH_COLLATION, UCOL_ON, &error);
1735 if (ucol_getAttribute(coll, UCOL_FRENCH_COLLATION, &error) != UCOL_ON ||
1740 ucol_setAttribute(coll, UCOL_ALTERNATE_HANDLING, UCOL_SHIFTED, &error);
1741 if (ucol_getAttribute(coll, UCOL_ALTERNATE_HANDLING, &error) != UCOL_SHIFTED ||
1746 ucol_setAttribute(coll, UCOL_ALTERNATE_HANDLING, UCOL_NON_IGNORABLE, &error);
1747 if (ucol_getAttribute(coll, UCOL_ALTERNATE_HANDLING, &error) != UCOL_NON_IGNORABLE ||
1752 ucol_setAttribute(coll, UCOL_CASE_FIRST, UCOL_LOWER_FIRST, &error);
1753 if (ucol_getAttribute(coll, UCOL_CASE_FIRST, &error) != UCOL_LOWER_FIRST ||
1758 ucol_setAttribute(coll, UCOL_CASE_FIRST, UCOL_UPPER_FIRST, &error);
1759 if (ucol_getAttribute(coll, UCOL_CASE_FIRST, &error) != UCOL_UPPER_FIRST ||
1764 ucol_setAttribute(coll, UCOL_CASE_LEVEL, UCOL_ON, &error);
1765 if (ucol_getAttribute(coll, UCOL_CASE_LEVEL, &error) != UCOL_ON ||
1770 ucol_setAttribute(coll, UCOL_CASE_LEVEL, UCOL_OFF, &error);
1771 if (ucol_getAttribute(coll, UCOL_CASE_LEVEL, &error) != UCOL_OFF ||
1776 ucol_setAttribute(coll, UCOL_NORMALIZATION_MODE, UCOL_ON, &error);
1777 if (ucol_getAttribute(coll, UCOL_NORMALIZATION_MODE, &error) != UCOL_ON ||
1782 ucol_setAttribute(coll, UCOL_NORMALIZATION_MODE, UCOL_OFF, &error);
1783 if (ucol_getAttribute(coll, UCOL_NORMALIZATION_MODE, &error) != UCOL_OFF ||
1788 ucol_setAttribute(coll, UCOL_STRENGTH, UCOL_PRIMARY, &error);
1789 if (ucol_getAttribute(coll, UCOL_STRENGTH, &error) != UCOL_PRIMARY ||
1794 ucol_setAttribute(coll, UCOL_STRENGTH, UCOL_SECONDARY, &error);
1795 if (ucol_getAttribute(coll, UCOL_STRENGTH, &error) != UCOL_SECONDARY ||
1800 ucol_setAttribute(coll, UCOL_STRENGTH, UCOL_TERTIARY, &error);
1801 if (ucol_getAttribute(coll, UCOL_STRENGTH, &error) != UCOL_TERTIARY ||
1806 ucol_setAttribute(coll, UCOL_STRENGTH, UCOL_QUATERNARY, &error);
1807 if (ucol_getAttribute(coll, UCOL_STRENGTH, &error) != UCOL_QUATERNARY ||
1812 ucol_setAttribute(coll, UCOL_STRENGTH, UCOL_IDENTICAL, &error);
1813 if (ucol_getAttribute(coll, UCOL_STRENGTH, &error) != UCOL_IDENTICAL ||
1818 ucol_close(coll);
1835 UCollator *coll = NULL;
1842 coll = ucol_openRules(buff, buffLen, UCOL_DEFAULT, UCOL_DEFAULT, &pError, &status);
1844 set = ucol_getTailoredSet(coll, &status);
1858 ucol_close(coll);
1877 UCollator *coll = ucol_open("en", &status);
1911 prefixKeyLen = ucol_getSortKey(coll, buffer, unescapedLen, prefixKey, 256);
1914 suffixKeyLen = ucol_getSortKey(coll, buffer, unescapedLen, suffixKey, 256);
1920 ucol_setAttribute(coll, UCOL_STRENGTH, strength, &status);
1923 sortKeysLen[i] = ucol_getSortKey(coll, buffer, unescapedLen, sortkeys[i], 256);
1930 ucol_sortKeyToString(coll, mergedPrefixkeys[i-1], outBuff1, l1),
1931 ucol_sortKeyToString(coll, mergedPrefixkeys[i], outBuff2, l2));
1936 ucol_sortKeyToString(coll, mergedSuffixkeys[i-1], outBuff1, l1),
1937 ucol_sortKeyToString(coll, mergedSuffixkeys[i], outBuff2, l2));
1964 emptyKeyLen = ucol_getSortKey(coll, &empty, 0, emptyKey, 20);
1966 abcKeyLen = ucol_getSortKey(coll, buffer, unescapedLen, abcKey, 50);
1992 ucol_close(coll);
2035 UCollator *coll = NULL, *fromNormalized = NULL;
2050 coll = ucol_openFromShortString(testCases[i].input, FALSE, &parseError, &status);
2058 ucol_getShortDefinitionString(coll, locale, fromShortBuffer, 256, &status);
2075 if(!ucol_equals(coll, fromNormalized)) {
2081 ucol_close(coll);
2188 UCollator *coll = NULL;
2200 coll = ucol_open(tests[i].locale, &status);
2201 if (coll == NULL || U_FAILURE(status)) {
2205 ucol_getContractionsAndExpansions(coll, conts, exp, TRUE, &status);
2223 noConts = ucol_getUnsafeSet(coll, conts, &status);
2234 ucol_close(coll);
2276 UCollator *coll = ucol_openRules(uRules, uRulesLen, UCOL_DEFAULT, UCOL_DEFAULT, NULL, &status);
2286 if((coll==NULL)||(U_FAILURE(status))) {
2297 imageSize = ucol_cloneBinary(coll, image, imageBufferCapacity, &status);
2301 imageSize = ucol_cloneBinary(coll, imageBuffer, imageSize, &status);
2313 genericOrderingTest(coll, wUCA, sizeof(wUCA)/sizeof(wUCA[0]));
2323 ucol_close(coll);
2332 UCollator *coll = ucol_open("es@collation=pinyin", &status);
2333 if (coll == NULL || status == U_FILE_ACCESS_ERROR) {
2341 ucol_close(coll);
2357 UCollator *coll = ucol_open(loc, &status);
2366 ucol_close(coll);
2464 UCollator *coll;
2478 coll = ucol_open(NULL, &status);
2485 if (ucol_strcoll(coll, NULL, 0, NULL, 0) != 0) {
2489 if (ucol_strcoll(coll, NULL, -1, NULL, 0) != 0) {
2494 if (ucol_strcoll(coll, u16asc, -1, NULL, 10) != 0) {
2499 if (ucol_strcoll(coll, u16asc, -1, NULL, 0) <= 0) {
2502 if (ucol_strcoll(coll, NULL, 0, u16asc, -1) >= 0) {
2505 if (ucol_strcoll(coll, u16asc, u16ascLen, NULL, 0) <= 0) {
2509 if (ucol_strcoll(coll, u16han, -1, NULL, 0) <= 0) {
2512 if (ucol_strcoll(coll, NULL, 0, u16han, -1) >= 0) {
2515 if (ucol_strcoll(coll, NULL, 0, u16han, u16hanLen) >= 0) {
2521 if (ucol_strcollUTF8(coll, NULL, 0, NULL, 0, &status) != 0 || U_FAILURE(status)) {
2525 ucol_strcollUTF8(coll, NULL, -1, NULL, 0, &status);
2530 ucol_strcollUTF8(coll, u8asc, u8ascLen, NULL, 10, &status);
2536 if (ucol_strcollUTF8(coll, u8asc, -1, NULL, 0, &status) <= 0 || U_FAILURE(status)) {
2540 if (ucol_strcollUTF8(coll, NULL, 0, u8asc, -1, &status) >= 0 || U_FAILURE(status)) {
2544 if (ucol_strcollUTF8(coll, u8asc, u8ascLen, NULL, 0, &status) <= 0 || U_FAILURE(status)) {
2549 if (ucol_strcollUTF8(coll, u8han, -1, NULL, 0, &status) <= 0 || U_FAILURE(status)) {
2553 if (ucol_strcollUTF8(coll, NULL, 0, u8han, -1, &status) >= 0 || U_FAILURE(status)) {
2557 if (ucol_strcollUTF8(coll, NULL, 0, u8han, u8hanLen, &status) >= 0 || U_FAILURE(status)) {
2561 ucol_close(coll);