Home | History | Annotate | Download | only in cintltst

Lines Matching full:coll

86   UCollator *coll =  NULL;
92 coll = ucol_openRules(temp, u_strlen(temp), UCOL_OFF, UCOL_DEFAULT_STRENGTH, NULL,&status);
101 doTest(coll, t1, t2, UCOL_LESS);
103 iter = ucol_openElements(coll, t2, u_strlen(t2), &status);
114 ucol_close(coll);
118 coll = ucol_openRules(temp, u_strlen(temp), UCOL_OFF, UCOL_DEFAULT_STRENGTH,NULL, &status);
127 doTest(coll, t1, t2, UCOL_LESS);
130 iter = ucol_openElements(coll, t2, u_strlen(t2), &status);
141 ucol_close(coll);
189 UCollator *coll = ucol_open("en_US", &status);
191 ucol_setAttribute(coll, UCOL_NORMALIZATION_MODE, UCOL_OFF, &status);
192 ucol_setAttribute(coll, UCOL_ALTERNATE_HANDLING, UCOL_NON_IGNORABLE, &status);
200 doTest(coll, t1, t2, UCOL_LESS);
205 ucol_setAttribute(coll, UCOL_ALTERNATE_HANDLING, UCOL_SHIFTED, &status);
206 ucol_setAttribute(coll, UCOL_STRENGTH, UCOL_QUATERNARY, &status);
214 doTest(coll, t1, t2, UCOL_LESS);
219 ucol_setAttribute(coll, UCOL_STRENGTH, UCOL_TERTIARY, &status);
225 doTest(coll, t1, t2, shiftedTert[i]);
229 ucol_close(coll);
336 UCollator *coll = ucol_open("en_US", &status);
356 ucol_setAttribute(coll, UCOL_CASE_FIRST, caseFirst[i], &status);
360 ucol_setAttribute(coll, UCOL_ALTERNATE_HANDLING, alternateHandling[i], &status);
364 ucol_setAttribute(coll, UCOL_CASE_LEVEL, caseLevel[j], &status);
368 ucol_setAttribute(coll, UCOL_STRENGTH, strengths[k], &status);
369 sortkeysize = ucol_getSortKey(coll, m, sizem, sortkey, 256);
371 fprintf(stderr, "%s\n", ucol_sortKeyToString(coll, sortkey, buffer, &len));
528 static void testCollator(UCollator *coll, UErrorCode *status) {
556 rules = ucol_getRules(coll, &ruleLen);
618 testEquality(coll,first,second);
621 testPrimary(coll,first,second);
624 testSecondary(coll,first,second);
627 testTertiary(coll,first,second);
909 static void testAgainstUCA(UCollator *coll, UCollator *UCA, const char *refName, UBool error, UErrorCode *status) {
934 rules = ucol_getRules(coll, &ruleLen);
1070 static void testCEs(UCollator *coll, UErrorCode *status) {
1108 colLoc = ucol_getLocaleByType(coll, ULOC_ACTUAL_LOCALE, status);
1124 rules = ucol_getRules(coll, &ruleLen);
1186 uprv_init_collIterate(coll, rulesCopy+chOffset, chLen, &c);
1188 currCE = ucol_getNextCE(coll, &c, status);
1191 currCE = ucol_getNextCE(coll, &c, status);
1194 currContCE = ucol_getNextCE(coll, &c, status);
1224 if(ucol_isTailored(coll, *(rulesCopy+oldOffset), status)) {
1318 UCollator *coll = NULL;
1341 coll = ucol_open(locName, &status);
1343 testAgainstUCA(coll, UCA, "UCA", FALSE, &status);
1344 ucol_close(coll);
1358 UCollator *coll = NULL;
1387 coll = ucol_open(locName, &status);
1389 if(coll->image->jamoSpecial == TRUE) {
1392 ucol_setAttribute(coll, UCOL_CASE_FIRST, UCOL_OFF, &status);
1393 testCollator(coll, &status);
1394 testCEs(coll, &status);
1395 ucol_close(coll);
1403 coll = ucol_openRules(rule, ruleLen, UCOL_OFF, UCOL_TERTIARY, NULL,&status);
1405 testCollator(coll, &status);
1406 testCEs(coll, &status);
1407 ucol_close(coll);
1416 UCollator *coll = NULL;
1433 coll = ucol_openRules(rule, ruleLen, UCOL_OFF, UCOL_TERTIARY, NULL,&status);
1436 if(!ucol_isTailored(coll, tailored[i], &status)) {
1441 if(ucol_isTailored(coll, notTailored[i], &status)) {
1445 ucol_close(coll);
1452 coll = ucol_open("ja", &status);
1453 if(!ucol_isTailored(coll, 0x4E9C, &status)) {
1456 ucol_close(coll);
1488 UCollator *coll = ucol_open("cs", &status);
1496 doTest(coll, t1, t2, UCOL_LESS);
1503 ucol_close(coll);
1547 UCollator *coll = NULL;
1550 coll = ucol_openRules(t1, ruleLen, UCOL_OFF, UCOL_TERTIARY,NULL, &status);
1558 doTest(coll, t1, t2, UCOL_LESS);
1565 ucol_close(coll);
1577 UCollator *coll = ucol_open("", &status);
1581 ucol_setAttribute(coll, UCOL_NORMALIZATION_MODE, UCOL_OFF, &status);
1582 doTest(coll, t1, t2, UCOL_EQUAL);
1584 ucol_setAttribute(coll, UCOL_NORMALIZATION_MODE, UCOL_ON, &status);
1585 doTest(coll, t1, t2, UCOL_EQUAL);
1587 ucol_close(coll);
1617 UCollator *coll = NULL;
1627 coll = ucol_open("", &status);
1665 if(!ucol_equal(coll, t[u]->NFC, -1, t[u]->NFD, -1)) {
1667 doTest(coll, t[u]->NFC, t[u]->NFD, UCOL_EQUAL);
1682 doTest(coll, comp, t[noCases]->NFD, UCOL_EQUAL);
1683 doTest(coll, comp, t[noCases]->NFC, UCOL_EQUAL);
1687 ucol_close(coll);
1704 coll = ucol_open(locName, &status);
1705 ucol_setStrength(coll, UCOL_IDENTICAL);
1706 iter = ucol_openElements(coll, t[u]->NFD, u_strlen(t[u]->NFD), &status);
1709 if(!ucol_equal(coll, t[u]->NFC, -1, t[u]->NFD, -1)) {
1711 doTest(coll, t[u]->NFC, t[u]->NFD, UCOL_EQUAL);
1721 ucol_close(coll);
1733 UCollator *coll = ucol_openRules(rulez, 0, UCOL_OFF, UCOL_TERTIARY,NULL, &status);
1735 ucol_close(coll);
1744 UCollator *coll = ucol_open("", &status);
1752 ruleLen = ucol_getRulesEx(coll, UCOL_FULL_RULES, rules, 256);
1757 ruleLen = ucol_getRulesEx(coll, UCOL_FULL_RULES, rules, ruleLen);
1768 ucol_getSortKey(coll, b, 1, res, 256);
1770 ucol_close(coll);
2211 UCollator *coll;
2227 coll = ucol_open("en_US", &status);
2235 ucol_setAttribute(coll, UCOL_NORMALIZATION_MODE, UCOL_ON, &status);
2251 ucol_setStrength(coll, UCOL_TERTIARY); /* Do test with default strength, which runs*/
2252 doTest(coll, strA, strB, UCOL_EQUAL); /* optimized functions in the impl*/
2253 ucol_setStrength(coll, UCOL_IDENTICAL); /* Do again with the slow, general impl.*/
2254 doTest(coll, strA, strB, UCOL_EQUAL);
2267 ucol_setStrength(coll, UCOL_TERTIARY);
2268 doTest(coll, strA, strB, UCOL_EQUAL);
2281 ucol_setStrength(coll, UCOL_TERTIARY);
2282 doTest(coll, strA, strB, UCOL_GREATER);
2297 /*result = ucol_strcoll(coll, strA, -3, strB, -3);*/
2298 result = ucol_strcoll(coll, strA, 3, strB, 3);
2302 result = ucol_strcoll(coll, strA, -1, strB, -1);
2307 ucol_getSortKey(coll, strA, 3, (uint8_t *)sortKeyA, sizeof(sortKeyA));
2308 ucol_getSortKey(coll, strA, -1, (uint8_t *)sortKeyAz, sizeof(sortKeyAz));
2309 ucol_getSortKey(coll, strB, 3, (uint8_t *)sortKeyB, sizeof(sortKeyB));
2310 ucol_getSortKey(coll, strB, -1, (uint8_t *)sortKeyBz, sizeof(sortKeyBz));
2325 ucol_setStrength(coll, UCOL_IDENTICAL);
2326 ucol_getSortKey(coll, strA, 3, (uint8_t *)sortKeyA, sizeof(sortKeyA));
2327 ucol_getSortKey(coll, strA, -1, (uint8_t *)sortKeyAz, sizeof(sortKeyAz));
2328 ucol_getSortKey(coll, strB, 3, (uint8_t *)sortKeyB, sizeof(sortKeyB));
2329 ucol_getSortKey(coll, strB, -1, (uint8_t *)sortKeyBz, sizeof(sortKeyBz));
2343 ucol_setStrength(coll, UCOL_TERTIARY);
2358 result = ucol_strcoll(coll, strA, 6, strB, 6);
2362 result = ucol_strcoll(coll, strA, -1, strB, -1);
2367 ucol_getSortKey(coll, strA, 6, (uint8_t *)sortKeyA, sizeof(sortKeyA));
2368 ucol_getSortKey(coll, strA, -1, (uint8_t *)sortKeyAz, sizeof(sortKeyAz));
2369 ucol_getSortKey(coll, strB, 6, (uint8_t *)sortKeyB, sizeof(sortKeyB));
2370 ucol_getSortKey(coll, strB, -1, (uint8_t *)sortKeyBz, sizeof(sortKeyBz));
2385 ucol_setStrength(coll, UCOL_IDENTICAL);
2386 ucol_getSortKey(coll, strA, 6, (uint8_t *)sortKeyA, sizeof(sortKeyA));
2387 ucol_getSortKey(coll, strA, -1, (uint8_t *)sortKeyAz, sizeof(sortKeyAz));
2388 ucol_getSortKey(coll, strB, 6, (uint8_t *)sortKeyB, sizeof(sortKeyB));
2389 ucol_getSortKey(coll, strB, -1, (uint8_t *)sortKeyBz, sizeof(sortKeyBz));
2403 ucol_setStrength(coll, UCOL_TERTIARY);
2413 result = ucol_strcoll(coll, strA, 5, strB, 5);
2417 result = ucol_strcoll(coll, strA, -1, strB, -1);
2423 ucol_close(coll);
2479 UCollator *coll = ucol_openRules(rlz, rlen, UCOL_DEFAULT, UCOL_DEFAULT,NULL, &status);
2491 genericOrderingTest(coll, koreanData, sizeof(koreanData)/sizeof(koreanData[0]));
2497 ((UCATableHeader *)coll->image)->jamoSpecial = TRUE; /* don't try this at home */
2498 genericOrderingTest(coll, koreanData, sizeof(koreanData)/sizeof(koreanData[0]));
2500 ucol_close(coll);
2510 UCollator *coll;
2516 coll = ucol_open("", &status);
2536 resultlen = ucol_getSortKey(coll, secstr, 150, (uint8_t *)result, 250);
2549 resultlen = ucol_getSortKey(coll, tertstr, 150, (uint8_t *)result, 250);
2554 if (*tempptr < coll->tertiaryTop - coll->tertiaryTopCount) {
2563 resultlen = ucol_getSortKey(coll, secstr, 150, (uint8_t *)result, 250);
2576 resultlen = ucol_getSortKey(coll, tertstr, 150, (uint8_t *)result, 250);
2581 coll->tertiaryBottom + coll->tertiaryBottomCount) {
2587 ucol_close(coll);
2654 UCollator *coll;
2664 coll = ucol_openRules(rule, rlen, UCOL_ON, UCOL_TERTIARY,NULL, &status);
2669 iter1 = ucol_openElements(coll, testdata[i], 2, &status);
2675 UCollationElements *iter2 = ucol_openElements(coll,
2699 ucol_close(coll);
2703 coll = ucol_openRules(rule, rlen, UCOL_ON, UCOL_TERTIARY,NULL, &status);
2704 if (ucol_strcoll(coll, testdata2[0], 2, testdata2[1], 2) != UCOL_LESS) {
2710 if (ucol_strcoll(coll, testdata2[1], 2, testdata2[2], 2) != UCOL_LESS) {
2716 ucol_close(coll);
2781 UCollator *coll;
2790 coll = ucol_openRules(rule, rlen, UCOL_ON, UCOL_TERTIARY,NULL, &status);
2797 doTest(coll, testdata[j], testdata[j + 1], UCOL_LESS);
2799 ucol_close(coll);
2903 UCollator *coll = ucol_open("", &status);
2905 ucol_setAttribute(coll, UCOL_STRENGTH, UCOL_IDENTICAL, &status);
2907 klen = ucol_getSortKey(coll, test, tlen, key, 256);
2909 ucol_close(coll);
2919 UCollator *coll = ucol_open("", &status);
2959 rulesLen = ucol_getRulesEx(coll, UCOL_FULL_RULES, rulesCopy, 0);
2961 rulesLen = ucol_getRulesEx(coll, UCOL_FULL_RULES, rulesCopy, rulesLen+UCOL_TOK_EXTRA_RULE_SPACE_SIZE);
2964 ucol_setAttribute(coll, UCOL_ALTERNATE_HANDLING, UCOL_SHIFTED, &status);
2986 varTopOriginal = ucol_getVariableTop(coll, &status);
2987 varTop1 = ucol_setVariableTop(coll, rulesCopy+oldChOffset, oldChLen, &status);
2996 uprv_init_collIterate(coll, rulesCopy+oldChOffset, oldChLen, &s);
2998 CE = ucol_getNextCE(coll, &s, &status);
3016 varTop2 = ucol_getVariableTop(coll, &status);
3038 result = ucol_strcoll(coll, first, -1, second, -1);
3040 doTest(coll, first, second, UCOL_EQUAL);
3071 /*UChar *conts = (UChar *)((uint8_t *)coll->image + coll->image->UCAConsts+sizeof(UCAConstants));*/
3072 UChar *conts = (UChar *)((uint8_t *)coll->image + coll->image->contractionUCACombos);
3075 varTop1 = ucol_setVariableTop(coll, conts, -1, &status);
3077 varTop1 = ucol_setVariableTop(coll, conts, 3, &status);
3093 ucol_setVariableTop(coll, first, -1, &status);
3104 ucol_restoreVariableTop(coll, varTopOriginal, &status);
3105 if(varTopOriginal != ucol_getVariableTop(coll, &status)) {
3112 varTop1 = ucol_setVariableTop(coll, first, 1, &status);
3113 varTop2 = ucol_getVariableTop(coll, &status);
3114 ucol_restoreVariableTop(coll, varTop2, &status);
3122 ucol_close(coll);
3151 UCollator *coll = ucol_open("en_US", &status);
3156 genericOrderingTestWithResult(coll, test, 35, UCOL_EQUAL);
3161 ucol_close(coll);
3192 UCollator *coll = ucol_open("en_US", status);
3506 UCollator *coll = NULL;
3510 coll = ucol_openRules(string, uStringLen, UCOL_DEFAULT, UCOL_DEFAULT, NULL, &status);
3512 /*coll = ucol_open("ja_JP_JIS", &status);*/
3513 it = ucol_openElements(coll, string, 0, &status);
3528 ucol_close(coll);
3549 UCollator *coll = NULL;
3553 coll = ucol_openRules(string, uStringLen, UCOL_DEFAULT, UCOL_DEFAULT, NULL, &status);
3554 ucol_close(coll);
3713 UCollator *coll = ucol_open("", &status);
3737 ucol_setAttribute(coll, UCOL_NORMALIZATION_MODE, UCOL_ON, &status);
3739 resU16 = ucol_strcollIter(coll, &iterU161, &iterU162, &status);
3740 resU8 = ucol_strcollIter(coll, &iterU81, &iterU82, &status);
3747 ucol_close(coll);
3783 UCollator *coll = ucol_open("", &status);
3791 ucol_setAttribute(coll, UCOL_NORMALIZATION_MODE, UCOL_ON, &status);
3797 resU16 = ucol_strcoll(coll, U16Source, U16LenS, U16Target, U16LenT);
3808 resU16BE = ucol_strcollIter(coll, &U16BEItS, &U16BEItT, &status);
3822 resU8 = ucol_strcollIter(coll, &U8ItS, &U8ItT, &status);
3830 ucol_close(coll);
3849 UCollator *coll = ucol_open("", &status);
3854 /*ucol_setAttribute(coll, UCOL_NORMALIZATION_MODE, UCOL_ON, &status);*/
3868 doTest(coll, utf16String[i], utf16String[j], UCOL_LESS);
3872 ucol_close(coll);
3886 UCollator *coll = ucol_open("", &status);
3900 pKeyLen = ucol_nextSortKeyPart(coll, &iter, state, key, 256, &status);
3905 ucol_close(coll);
4092 UCollator *coll = ucol_open("en", &status);
4093 ucol_setAttribute(coll, UCOL_ALTERNATE_HANDLING, UCOL_SHIFTED, &status);
4094 ucol_setAttribute(coll, UCOL_STRENGTH, UCOL_PRIMARY, &status);
4095 doTest(coll, a, aSpace, UCOL_EQUAL);
4096 doTest(coll, aSpace, a, UCOL_EQUAL);
4097 doTest(coll, a, spaceA, UCOL_EQUAL);
4098 doTest(coll, spaceA, a, UCOL_EQUAL);
4099 doTest(coll, spaceA, aSpace, UCOL_EQUAL);
4100 doTest(coll, aSpace, spaceA, UCOL_EQUAL);
4101 ucol_close(coll);
4107 UCollator *coll = ucol_openRules(r, 1, UCOL_DEFAULT, UCOL_DEFAULT, NULL, &status);
4110 ucol_close(coll);
4114 coll = ucol_openRules(r, 0, UCOL_DEFAULT, UCOL_DEFAULT, NULL, &status);
4118 ucol_close(coll);
4216 UCollator* coll = ucol_open("root", &status);
4230 ucol_setAttribute(coll, UCOL_NUMERIC_COLLATION, UCOL_ON, &status);
4241 genericOrderingTestWithResult(coll, preZeroTestStrings, sizeof(preZeroTestStrings)/sizeof(preZeroTestStrings[0]), UCOL_EQUAL);
4243 ucol_close(coll);
4254 UCollator *coll = ucol_open("", &status);
4258 ucol_setAttribute(coll, UCOL_NORMALIZATION_MODE, UCOL_ON, &status);
4262 doTest(coll, source, target, UCOL_EQUAL);
4263 result = ucol_strcoll(coll, source, -1, target, -1);
4269 ucol_close(coll);
4302 UCollator *coll = ucol_open("root", &status);
4351 ucol_close(coll);
4571 UCollator *coll = NULL;
4576 coll = ucol_openRules(rlz, rlen, UCOL_DEFAULT, UCOL_DEFAULT,NULL, &status);
4581 ucol_close(coll);
4704 UCollator *coll = NULL;
4708 coll = ucol_openRules(rlz, rlen, UCOL_DEFAULT, UCOL_DEFAULT,NULL, &status);
4713 res = ucol_strcoll(coll, &a, 1, &null, 1);
4720 ucol_close(coll);
4737 UCollator *coll = ucol_open("th", &status);
4743 keyLen = ucol_getSortKey(coll, &yamakan, 1, key, 256);
4748 ucol_close(coll);
4789 static UCollator *coll = NULL;
4790 coll = ucol_open("root", &status);
4795 ucol_setStrength(coll, UCOL_PRIMARY);
4796 ucol_setAttribute(coll, UCOL_STRENGTH, UCOL_PRIMARY, &status);
4797 ucol_setAttribute(coll, UCOL_NORMALIZATION_MODE, UCOL_ON, &status);
4802 sortkey_length = ucol_getSortKey(coll, ustr, ustr_length, NULL, 0);
4809 sortkey_length = ucol_getSortKey(coll, ustr, ustr_length, sortkey,
4821 sortkey_length = ucol_getSortKey(coll, ustr, ustr_length, sortkey,
4829 ucol_close(coll);
4857 UCollator *coll =NULL;
4898 coll = ucol_open("vi", &status);
4904 if ( !ucol_equal(coll, tData[0], u_strlen(tData[0]), tData[2], u_strlen(tData[2])) ) {
4907 if ( !ucol_equal(coll, tData[0], u_strlen(tData[0]), tData[3], u_strlen(tData[3])) ) {
4910 if ( !ucol_equal(coll, tData[5], u_strlen(tData[5]), tData[4], u_strlen(tData[4])) ) {
4913 if ( !ucol_equal(coll, tData[7], u_strlen(tData[7]), tData[6], u_strlen(tData[6])) ) {
4920 rLen = ucol_getSortKey(coll, tData[j], tLen, resColl, 100);
4926 ucol_close(coll);
4929 coll = ucol_open("ro", &status);
4931 if ( !ucol_equal(coll
4934 if ( !ucol_equal(coll, tData[4], u_strlen(tData[4]), tData[5], u_strlen(tData[5])) ) {
4937 if ( !ucol_equal(coll, tData[6], u_strlen(tData[6]), tData[7], u_strlen(tData[7])) ) {
4944 rLen = ucol_getSortKey(coll, tData[j], tLen, resColl, 100);
4949 ucol_close(coll);
4954 coll = ucol_openRules(rule, ruleLen, UCOL_OFF, UCOL_TERTIARY, NULL,&status);
4962 if ( !ucol_equal(coll, tailorData[0], sLen, tailorData[j], tLen)) {
4968 kLen=ucol_getSortKey(coll, tailorData[0], tLen, expColl, 100);
4971 rLen = ucol_getSortKey(coll, tailorData[j], tLen, resColl, 100);
4979 ucol_close(coll);
4983 coll = ucol_openRules(rule2, ruleLen, UCOL_OFF, UCOL_TERTIARY, NULL,&status);
4985 kLen=ucol_getSortKey(coll, tailorData2[0], tLen, expColl, 100);
4988 rLen = ucol_getSortKey(coll, tailorData2[j], tLen, resColl, 100);
4996 ucol_close(coll);
5000 coll = ucol_openRules(rule3, ruleLen, UCOL_OFF, UCOL_TERTIARY, NULL,&status);
5002 kLen=ucol_getSortKey(coll, tailorData3[3], tLen, expColl, 100);
5005 rLen = ucol_getSortKey(coll, tailorData3[j], tLen, resColl, 100);
5019 ucol_close(coll);
5027 UCollator *coll =NULL;
5063 coll = ucol_openRules(rule1, ruleLen, UCOL_OFF, UCOL_TERTIARY, NULL,&status);
5069 rLen = ucol_getSortKey(coll, tData1[0], tLen, resColl, 100);
5077 rLen = ucol_getSortKey(coll, tData1[1], tLen, resColl, 100);
5084 ucol_close(coll);
5090 coll = ucol_openRules(rule2, ruleLen, UCOL_OFF, UCOL_TERTIARY, NULL,&status);
5096 rLen = ucol_getSortKey(coll, tData2[0], tLen, resColl, 100);
5108 rLen = ucol_getSortKey(coll, tData2[1], tLen, resColl, 100);
5119 ucol_close(coll);
5127 UCollator *coll =NULL;
5149 coll = ucol_open("en", &status);
5156 rLen = ucol_getSortKey(coll, tData1[j], tLen, resColl, 100);
5167 ucol_close(coll);
5171 coll = ucol_open("ja", &status);
5178 rLen = ucol_getSortKey(coll, tData1[j], tLen, resColl, 100);
5189 ucol_close(coll);
5194 coll = ucol_openRules(rule1, ruleLen, UCOL_OFF, UCOL_TERTIARY, NULL,&status);
5201 rLen = ucol_getSortKey(coll, tData1[j], tLen, resColl, 100);
5212 ucol_close(coll);
5217 coll = ucol_openRules(rule2, ruleLen, UCOL_OFF, UCOL_TERTIARY, NULL,&status);
5224 rLen = ucol_getSortKey(coll, tData1[j], tLen, resColl, 100);
5239 ucol_close(coll);
5251 static UCollator *coll = NULL;
5253 coll = ucol_open("root", &status);
5258 ucol_setStrength(coll, UCOL_PRIMARY);
5259 ucol_setAttribute(coll, UCOL_STRENGTH, UCOL_PRIMARY, &status);
5260 ucol_setAttribute(coll, UCOL_NORMALIZATION_MODE, UCOL_ON, &status);
5266 sortkey_length = ucol_getSortKey(coll, ustr, ustr_length, shortKeyBuf, sizeof(shortKeyBuf));
5271 ucol_close(coll);