Lines Matching defs:coll
88 UCollator *coll = NULL;
94 coll = ucol_openRules(temp, u_strlen(temp), UCOL_OFF, UCOL_DEFAULT_STRENGTH, NULL,&status);
103 doTest(coll, t1, t2, UCOL_LESS);
105 iter = ucol_openElements(coll, t2, u_strlen(t2), &status);
116 ucol_close(coll);
120 coll = ucol_openRules(temp, u_strlen(temp), UCOL_OFF, UCOL_DEFAULT_STRENGTH,NULL, &status);
129 doTest(coll, t1, t2, UCOL_LESS);
132 iter = ucol_openElements(coll, t2, u_strlen(t2), &status);
143 ucol_close(coll);
191 UCollator *coll = ucol_open("en_US", &status);
193 ucol_setAttribute(coll, UCOL_NORMALIZATION_MODE, UCOL_OFF, &status);
194 ucol_setAttribute(coll, UCOL_ALTERNATE_HANDLING, UCOL_NON_IGNORABLE, &status);
202 doTest(coll, t1, t2, UCOL_LESS);
207 ucol_setAttribute(coll, UCOL_ALTERNATE_HANDLING, UCOL_SHIFTED, &status);
208 ucol_setAttribute(coll, UCOL_STRENGTH, UCOL_QUATERNARY, &status);
216 doTest(coll, t1, t2, UCOL_LESS);
221 ucol_setAttribute(coll, UCOL_STRENGTH, UCOL_TERTIARY, &status);
227 doTest(coll, t1, t2, shiftedTert[i]);
231 ucol_close(coll);
338 UCollator *coll = ucol_open("en_US", &status);
358 ucol_setAttribute(coll, UCOL_CASE_FIRST, caseFirst[i], &status);
362 ucol_setAttribute(coll, UCOL_ALTERNATE_HANDLING, alternateHandling[i], &status);
366 ucol_setAttribute(coll, UCOL_CASE_LEVEL, caseLevel[j], &status);
370 ucol_setAttribute(coll, UCOL_STRENGTH, strengths[k], &status);
371 sortkeysize = ucol_getSortKey(coll, m, sizem, sortkey, 256);
373 fprintf(stderr, "%s\n", ucol_sortKeyToString(coll, sortkey, buffer, &len));
530 static void testCollator(UCollator *coll, UErrorCode *status) {
560 rules = ucol_getRules(coll, &ruleLen);
624 testEquality(coll,first,second);
627 testPrimary(coll,first,second);
630 testSecondary(coll,first,second);
633 testTertiary(coll,first,second);
915 static void testAgainstUCA(UCollator *coll, UCollator *UCA, const char *refName, UBool error, UErrorCode *status) {
941 rules = ucol_getRules(coll, &ruleLen);
1079 static void testCEs(UCollator *coll, UErrorCode *status) {
1118 colLoc = ucol_getLocaleByType(coll, ULOC_ACTUAL_LOCALE, status);
1138 rules = ucol_getRules(coll, &ruleLen);
1202 uprv_init_collIterate(coll, src.source+chOffset, chLen, c, status);
1204 currCE = ucol_getNextCE(coll, c, status);
1207 currCE = ucol_getNextCE(coll, c, status);
1210 currContCE = ucol_getNextCE(coll, c, status);
1240 if(ucol_isTailored(coll, *(src.source+oldOffset), status)) {
1335 UCollator *coll = NULL;
1358 coll = ucol_open(locName, &status);
1360 testAgainstUCA(coll, UCA, "UCA", FALSE, &status);
1361 ucol_close(coll);
1375 UCollator *coll = NULL;
1415 coll = ucol_open(locName, &status);
1418 if(coll->image->jamoSpecial == TRUE) {
1421 ucol_setAttribute(coll, UCOL_CASE_FIRST, UCOL_OFF, &status);
1422 testCollator(coll, &status);
1423 testCEs(coll, &status);
1427 ucol_close(coll);
1438 coll = ucol_openRules(rule, ruleLen, UCOL_OFF, UCOL_TERTIARY, NULL,&status);
1440 testCollator(coll, &status);
1441 testCEs(coll, &status);
1442 ucol_close(coll);
1453 UCollator *coll = NULL;
1470 coll = ucol_openRules(rule, ruleLen, UCOL_OFF, UCOL_TERTIARY, NULL,&status);
1473 if(!ucol_isTailored(coll, tailored[i], &status)) {
1478 if(ucol_isTailored(coll, notTailored[i], &status)) {
1482 ucol_close(coll);
1489 coll = ucol_open("ja", &status);
1490 if(!ucol_isTailored(coll, 0x4E9C, &status)) {
1493 ucol_close(coll);
1525 UCollator *coll = ucol_open("cs", &status);
1533 doTest(coll, t1, t2, UCOL_LESS);
1540 ucol_close(coll);
1584 UCollator *coll = NULL;
1587 coll = ucol_openRules(t1, ruleLen, UCOL_OFF, UCOL_TERTIARY,NULL, &status);
1595 doTest(coll, t1, t2, UCOL_LESS);
1602 ucol_close(coll);
1614 UCollator *coll = ucol_open("", &status);
1618 ucol_setAttribute(coll, UCOL_NORMALIZATION_MODE, UCOL_OFF, &status);
1619 doTest(coll, t1, t2, UCOL_EQUAL);
1621 ucol_setAttribute(coll, UCOL_NORMALIZATION_MODE, UCOL_ON, &status);
1622 doTest(coll, t1, t2, UCOL_EQUAL);
1624 ucol_close(coll);
1654 UCollator *coll = NULL;
1664 coll = ucol_open("", &status);
1702 if(!ucol_equal(coll, t[u]->NFC, -1, t[u]->NFD, -1)) {
1704 doTest(coll, t[u]->NFC, t[u]->NFD, UCOL_EQUAL);
1719 doTest(coll, comp, t[noCases]->NFD, UCOL_EQUAL);
1720 doTest(coll, comp, t[noCases]->NFC, UCOL_EQUAL);
1724 ucol_close(coll);
1741 coll = ucol_open(locName, &status);
1742 ucol_setStrength(coll, UCOL_IDENTICAL);
1743 iter = ucol_openElements(coll, t[u]->NFD, u_strlen(t[u]->NFD), &status);
1746 if(!ucol_equal(coll, t[u]->NFC, -1, t[u]->NFD, -1)) {
1748 doTest(coll, t[u]->NFC, t[u]->NFD, UCOL_EQUAL);
1758 ucol_close(coll);
1770 UCollator *coll = ucol_openRules(rulez, 0, UCOL_OFF, UCOL_TERTIARY,NULL, &status);
1772 ucol_close(coll);
1781 UCollator *coll = ucol_open("", &status);
1789 ruleLen = ucol_getRulesEx(coll, UCOL_FULL_RULES, rules, 256);
1794 ruleLen = ucol_getRulesEx(coll, UCOL_FULL_RULES, rules, ruleLen);
1805 ucol_getSortKey(coll, b, 1, res, 256);
1807 ucol_close(coll);
2248 UCollator *coll;
2264 coll = ucol_open("en_US", &status);
2272 ucol_setAttribute(coll, UCOL_NORMALIZATION_MODE, UCOL_ON, &status);
2288 ucol_setStrength(coll, UCOL_TERTIARY); /* Do test with default strength, which runs*/
2289 doTest(coll, strA, strB, UCOL_EQUAL); /* optimized functions in the impl*/
2290 ucol_setStrength(coll, UCOL_IDENTICAL); /* Do again with the slow, general impl.*/
2291 doTest(coll, strA, strB, UCOL_EQUAL);
2304 ucol_setStrength(coll, UCOL_TERTIARY);
2305 doTest(coll, strA, strB, UCOL_EQUAL);
2318 ucol_setStrength(coll, UCOL_TERTIARY);
2319 doTest(coll, strA, strB, UCOL_GREATER);
2334 /*result = ucol_strcoll(coll, strA, -3, strB, -3);*/
2335 result = ucol_strcoll(coll, strA, 3, strB, 3);
2339 result = ucol_strcoll(coll, strA, -1, strB, -1);
2344 ucol_getSortKey(coll, strA, 3, (uint8_t *)sortKeyA, sizeof(sortKeyA));
2345 ucol_getSortKey(coll, strA, -1, (uint8_t *)sortKeyAz, sizeof(sortKeyAz));
2346 ucol_getSortKey(coll, strB, 3, (uint8_t *)sortKeyB, sizeof(sortKeyB));
2347 ucol_getSortKey(coll, strB, -1, (uint8_t *)sortKeyBz, sizeof(sortKeyBz));
2362 ucol_setStrength(coll, UCOL_IDENTICAL);
2363 ucol_getSortKey(coll, strA, 3, (uint8_t *)sortKeyA, sizeof(sortKeyA));
2364 ucol_getSortKey(coll, strA, -1, (uint8_t *)sortKeyAz, sizeof(sortKeyAz));
2365 ucol_getSortKey(coll, strB, 3, (uint8_t *)sortKeyB, sizeof(sortKeyB));
2366 ucol_getSortKey(coll, strB, -1, (uint8_t *)sortKeyBz, sizeof(sortKeyBz));
2380 ucol_setStrength(coll, UCOL_TERTIARY);
2395 result = ucol_strcoll(coll, strA, 6, strB, 6);
2399 result = ucol_strcoll(coll, strA, -1, strB, -1);
2404 ucol_getSortKey(coll, strA, 6, (uint8_t *)sortKeyA, sizeof(sortKeyA));
2405 ucol_getSortKey(coll, strA, -1, (uint8_t *)sortKeyAz, sizeof(sortKeyAz));
2406 ucol_getSortKey(coll, strB, 6, (uint8_t *)sortKeyB, sizeof(sortKeyB));
2407 ucol_getSortKey(coll, strB, -1, (uint8_t *)sortKeyBz, sizeof(sortKeyBz));
2422 ucol_setStrength(coll, UCOL_IDENTICAL);
2423 ucol_getSortKey(coll, strA, 6, (uint8_t *)sortKeyA, sizeof(sortKeyA));
2424 ucol_getSortKey(coll, strA, -1, (uint8_t *)sortKeyAz, sizeof(sortKeyAz));
2425 ucol_getSortKey(coll, strB, 6, (uint8_t *)sortKeyB, sizeof(sortKeyB));
2426 ucol_getSortKey(coll, strB, -1, (uint8_t *)sortKeyBz, sizeof(sortKeyBz));
2440 ucol_setStrength(coll, UCOL_TERTIARY);
2450 result = ucol_strcoll(coll, strA, 5, strB, 5);
2454 result = ucol_strcoll(coll, strA, -1, strB, -1);
2460 ucol_close(coll);
2516 UCollator *coll = ucol_openRules(rlz, rlen, UCOL_DEFAULT, UCOL_DEFAULT,NULL, &status);
2528 genericOrderingTest(coll, koreanData, sizeof(koreanData)/sizeof(koreanData[0]));
2534 ((UCATableHeader *)coll->image)->jamoSpecial = TRUE; /* don't try this at home */
2535 genericOrderingTest(coll, koreanData, sizeof(koreanData)/sizeof(koreanData[0]));
2537 ucol_close(coll);
2547 UCollator *coll;
2553 coll = ucol_open("", &status);
2573 resultlen = ucol_getSortKey(coll, secstr, 150, (uint8_t *)result, 250);
2586 resultlen = ucol_getSortKey(coll, tertstr, 150, (uint8_t *)result, 250);
2591 if (*tempptr < coll->tertiaryTop - coll->tertiaryTopCount) {
2600 resultlen = ucol_getSortKey(coll, secstr, 150, (uint8_t *)result, 250);
2613 resultlen = ucol_getSortKey(coll, tertstr, 150, (uint8_t *)result, 250);
2618 if (*tempptr > coll->tertiaryBottom + coll->tertiaryBottomCount) {
2624 ucol_close(coll);
2691 UCollator *coll;
2701 coll = ucol_openRules(rule, rlen, UCOL_ON, UCOL_TERTIARY,NULL, &status);
2706 iter1 = ucol_openElements(coll, testdata[i], 2, &status);
2712 UCollationElements *iter2 = ucol_openElements(coll,
2736 ucol_close(coll);
2740 coll = ucol_openRules(rule, rlen, UCOL_ON, UCOL_TERTIARY,NULL, &status);
2741 if (ucol_strcoll(coll, testdata2[0], 2, testdata2[1], 2) != UCOL_LESS) {
2747 if (ucol_strcoll(coll, testdata2[1], 2, testdata2[2], 2) != UCOL_LESS) {
2753 ucol_close(coll);
2818 UCollator *coll;
2827 coll = ucol_openRules(rule, rlen, UCOL_ON, UCOL_TERTIARY,NULL, &status);
2834 doTest(coll, testdata[j], testdata[j + 1], UCOL_LESS);
2836 ucol_close(coll);
2940 UCollator *coll = ucol_open("", &status);
2942 ucol_setAttribute(coll, UCOL_STRENGTH, UCOL_IDENTICAL, &status);
2944 klen = ucol_getSortKey(coll, test, tlen, key, 256);
2946 ucol_close(coll);
2956 UCollator *coll = ucol_open("", &status);
2998 rulesLen = ucol_getRulesEx(coll, UCOL_FULL_RULES, rulesCopy, 0);
3000 rulesLen = ucol_getRulesEx(coll, UCOL_FULL_RULES, rulesCopy, rulesLen+UCOL_TOK_EXTRA_RULE_SPACE_SIZE);
3003 ucol_setAttribute(coll, UCOL_ALTERNATE_HANDLING, UCOL_SHIFTED, &status);
3027 varTopOriginal = ucol_getVariableTop(coll, &status);
3028 varTop1 = ucol_setVariableTop(coll, src.source+oldChOffset, oldChLen, &status);
3038 uprv_init_collIterate(coll, src.source+oldChOffset, oldChLen, s, &collIterateStatus);
3040 CE = ucol_getNextCE(coll, s, &status);
3059 varTop2 = ucol_getVariableTop(coll, &status);
3081 result = ucol_strcoll(coll, first, -1, second, -1);
3083 doTest(coll, first, second, UCOL_EQUAL);
3114 /*UChar *conts = (UChar *)((uint8_t *)coll->image + coll->image->UCAConsts+sizeof(UCAConstants));*/
3115 UChar *conts = (UChar *)((uint8_t *)coll->image + coll->image->contractionUCACombos);
3118 varTop1 = ucol_setVariableTop(coll, conts, -1, &status);
3120 varTop1 = ucol_setVariableTop(coll, conts, 3, &status);
3143 ucol_setVariableTop(coll, first, -1, &status);
3154 ucol_restoreVariableTop(coll, varTopOriginal, &status);
3155 if(varTopOriginal != ucol_getVariableTop(coll, &status)) {
3162 varTop1 = ucol_setVariableTop(coll, first, 1, &status);
3163 varTop2 = ucol_getVariableTop(coll, &status);
3164 ucol_restoreVariableTop(coll, varTop2, &status);
3172 ucol_close(coll);
3203 UCollator *coll = ucol_open("en_US", &status);
3208 genericOrderingTestWithResult(coll, test, 35, UCOL_LESS);
3213 ucol_close(coll);
3244 UCollator *coll = ucol_open("en_US", status);
3558 UCollator *coll = NULL;
3562 coll = ucol_openRules(string, uStringLen, UCOL_DEFAULT, UCOL_DEFAULT, NULL, &status);
3564 /*coll = ucol_open("ja_JP_JIS", &status);*/
3565 it = ucol_openElements(coll, string, 0, &status);
3580 ucol_close(coll);
3601 UCollator *coll = NULL;
3605 coll = ucol_openRules(string, uStringLen, UCOL_DEFAULT, UCOL_DEFAULT, NULL, &status);
3606 ucol_close(coll);
3795 UCollator *coll = ucol_open("", &status);
3819 ucol_setAttribute(coll, UCOL_NORMALIZATION_MODE, UCOL_ON, &status);
3821 resU16 = ucol_strcollIter(coll, &iterU161, &iterU162, &status);
3822 resU8 = ucol_strcollIter(coll, &iterU81, &iterU82, &status);
3829 ucol_close(coll);
3865 UCollator *coll = ucol_open("", &status);
3873 ucol_setAttribute(coll, UCOL_NORMALIZATION_MODE, UCOL_ON, &status);
3879 resU16 = ucol_strcoll(coll, U16Source, U16LenS, U16Target, U16LenT);
3890 resU16BE = ucol_strcollIter(coll, &U16BEItS, &U16BEItT, &status);
3904 resU8 = ucol_strcollIter(coll, &U8ItS, &U8ItT, &status);
3912 ucol_close(coll);
3931 UCollator *coll = ucol_open("", &status);
3936 /*ucol_setAttribute(coll, UCOL_NORMALIZATION_MODE, UCOL_ON, &status);*/
3950 doTest(coll, utf16String[i], utf16String[j], UCOL_LESS);
3954 ucol_close(coll);
3968 UCollator *coll = ucol_open("", &status);
3982 pKeyLen = ucol_nextSortKeyPart(coll, &iter, state, key, 256, &status);
3987 ucol_close(coll);
4174 UCollator *coll = ucol_open("en", &status);
4175 ucol_setAttribute(coll, UCOL_ALTERNATE_HANDLING, UCOL_SHIFTED, &status);
4176 ucol_setAttribute(coll, UCOL_STRENGTH, UCOL_PRIMARY, &status);
4177 doTest(coll, a, aSpace, UCOL_EQUAL);
4178 doTest(coll, aSpace, a, UCOL_EQUAL);
4179 doTest(coll, a, spaceA, UCOL_EQUAL);
4180 doTest(coll, spaceA, a, UCOL_EQUAL);
4181 doTest(coll, spaceA, aSpace, UCOL_EQUAL);
4182 doTest(coll, aSpace, spaceA, UCOL_EQUAL);
4183 ucol_close(coll);
4189 UCollator *coll = ucol_openRules(r, 1, UCOL_DEFAULT, UCOL_DEFAULT, NULL, &status);
4192 ucol_close(coll);
4196 coll = ucol_openRules(r, 0, UCOL_DEFAULT, UCOL_DEFAULT, NULL, &status);
4200 ucol_close(coll);
4298 UCollator* coll = ucol_open("root", &status);
4312 ucol_setAttribute(coll, UCOL_NUMERIC_COLLATION, UCOL_ON, &status);
4323 genericOrderingTestWithResult(coll, preZeroTestStrings, sizeof(preZeroTestStrings)/sizeof(preZeroTestStrings[0]), UCOL_EQUAL);
4325 ucol_close(coll);
4336 UCollator *coll = ucol_open("", &status);
4340 ucol_setAttribute(coll, UCOL_NORMALIZATION_MODE, UCOL_ON, &status);
4344 doTest(coll, source, target, UCOL_EQUAL);
4345 result = ucol_strcoll(coll, source, -1, target, -1);
4351 ucol_close(coll);
4384 UCollator *coll = ucol_open("root", &status);
4433 ucol_close(coll);
4653 UCollator *coll = NULL;
4658 coll = ucol_openRules(rlz, rlen, UCOL_DEFAULT, UCOL_DEFAULT,NULL, &status);
4663 ucol_close(coll);
4786 UCollator *coll = NULL;
4790 coll = ucol_openRules(rlz, rlen, UCOL_DEFAULT, UCOL_DEFAULT,NULL, &status);
4795 res = ucol_strcoll(coll, &a, 1, &null, 1);
4802 ucol_close(coll);
4843 static UCollator *coll = NULL;
4844 coll = ucol_open("root", &status);
4849 ucol_setStrength(coll, UCOL_PRIMARY);
4850 ucol_setAttribute(coll, UCOL_STRENGTH, UCOL_PRIMARY, &status);
4851 ucol_setAttribute(coll, UCOL_NORMALIZATION_MODE, UCOL_ON, &status);
4856 sortkey_length = ucol_getSortKey(coll, ustr, ustr_length, NULL, 0);
4863 sortkey_length = ucol_getSortKey(coll, ustr, ustr_length, sortkey,
4875 sortkey_length = ucol_getSortKey(coll, ustr, ustr_length, sortkey,
4883 ucol_close(coll);
4911 UCollator *coll =NULL;
4952 coll = ucol_open("vi", &status);
4958 if ( !ucol_equal(coll, tData[0], u_strlen(tData[0]), tData[2], u_strlen(tData[2])) ) {
4961 if ( !ucol_equal(coll, tData[0], u_strlen(tData[0]), tData[3], u_strlen(tData[3])) ) {
4964 if ( !ucol_equal(coll, tData[5], u_strlen(tData[5]), tData[4], u_strlen(tData[4])) ) {
4967 if ( !ucol_equal(coll, tData[7], u_strlen(tData[7]), tData[6], u_strlen(tData[6])) ) {
4974 rLen = ucol_getSortKey(coll, tData[j], tLen, resColl, 100);
4980 ucol_close(coll);
4983 coll = ucol_open("ro", &status);
4985 if ( !ucol_equal(coll, tData[0], u_strlen(tData[0]), tData[1], u_strlen(tData[1])) ) {
4988 if ( !ucol_equal(coll, tData[4], u_strlen(tData[4]), tData[5], u_strlen(tData[5])) ) {
4991 if ( !ucol_equal(coll, tData[6], u_strlen(tData[6]), tData[7], u_strlen(tData[7])) ) {
4998 rLen = ucol_getSortKey(coll, tData[j], tLen, resColl, 100);
5003 ucol_close(coll);
5008 coll = ucol_openRules(rule, ruleLen, UCOL_OFF, UCOL_TERTIARY, NULL,&status);
5016 if ( !ucol_equal(coll, tailorData[0], sLen, tailorData[j], tLen)) {
5022 kLen=ucol_getSortKey(coll, tailorData[0], tLen, expColl, 100);
5025 rLen = ucol_getSortKey(coll, tailorData[j], tLen, resColl, 100);
5033 ucol_close(coll);
5037 coll = ucol_openRules(rule2, ruleLen, UCOL_OFF, UCOL_TERTIARY, NULL,&status);
5039 kLen=ucol_getSortKey(coll, tailorData2[0], tLen, expColl, 100);
5042 rLen = ucol_getSortKey(coll, tailorData2[j], tLen, resColl, 100);
5050 ucol_close(coll);
5054 coll = ucol_openRules(rule3, ruleLen, UCOL_OFF, UCOL_TERTIARY, NULL,&status);
5056 kLen=ucol_getSortKey(coll, tailorData3[3], tLen, expColl, 100);
5059 rLen = ucol_getSortKey(coll, tailorData3[j], tLen, resColl, 100);
5073 ucol_close(coll);
5081 UCollator *coll =NULL;
5120 coll = ucol_openRules(rule1, ruleLen, UCOL_OFF, UCOL_TERTIARY, NULL,&status);
5126 rLen = ucol_getSortKey(coll, tData1[0], tLen, resColl, 100);
5134 rLen = ucol_getSortKey(coll, tData1[1], tLen, resColl, 100);
5141 ucol_close(coll);
5147 coll = ucol_openRules(rule2, ruleLen, UCOL_OFF, UCOL_TERTIARY, NULL,&status);
5153 rLen = ucol_getSortKey(coll, tData2[0], tLen, resColl, 100);
5165 rLen = ucol_getSortKey(coll, tData2[1], tLen, resColl, 100);
5176 ucol_close(coll);
5184 UCollator *coll =NULL;
5206 coll = ucol_open("en", &status);
5213 rLen = ucol_getSortKey(coll, tData1[j], tLen, resColl, 100);
5224 ucol_close(coll);
5228 coll = ucol_open("ja", &status);
5235 rLen = ucol_getSortKey(coll, tData1[j], tLen, resColl, 100);
5246 ucol_close(coll);
5251 coll = ucol_openRules(rule1, ruleLen, UCOL_OFF, UCOL_TERTIARY, NULL,&status);
5258 rLen = ucol_getSortKey(coll, tData1[j], tLen, resColl, 100);
5269 ucol_close(coll);
5274 coll = ucol_openRules(rule2, ruleLen, UCOL_OFF, UCOL_TERTIARY, NULL,&status);
5281 rLen = ucol_getSortKey(coll, tData1[j], tLen, resColl, 100);
5296 ucol_close(coll);
5308 static UCollator *coll = NULL;
5310 coll = ucol_open("root", &status);
5315 ucol_setStrength(coll, UCOL_PRIMARY);
5316 ucol_setAttribute(coll, UCOL_STRENGTH, UCOL_PRIMARY, &status);
5317 ucol_setAttribute(coll, UCOL_NORMALIZATION_MODE, UCOL_ON, &status);
5323 sortkey_length = ucol_getSortKey(coll, ustr, ustr_length, shortKeyBuf, sizeof(shortKeyBuf));
5328 ucol_close(coll);