Lines Matching refs:col
98 Collator *col = 0;
114 col = Collator::createInstance(Locale::getEnglish(), success);
120 StringEnumeration* kwEnum = col->getKeywordValuesForLocale("", Locale::getEnglish(),true,success);
127 col->getVersion(versionArray);
138 doAssert((col->compare("ab", "abc") == Collator::LESS), "ab < abc comparison failed");
139 doAssert((col->compare("ab", "AB") == Collator::LESS), "ab < AB comparison failed");
140 doAssert((col->compare("blackbird", "black-bird") == Collator::GREATER), "black-bird > blackbird comparison failed");
141 doAssert((col->compare("black bird", "black-bird") == Collator::LESS), "black bird > black-bird comparison failed");
142 doAssert((col->compare("Hello", "hello") == Collator::GREATER), "Hello > hello comparison failed");
143 doAssert((col->compare("","",success) == UCOL_EQUAL), "Comparison between empty strings failed");
145 doAssert((col->compareUTF8("\x61\x62\xc3\xa4", "\x61\x62\xc3\x9f", success) == UCOL_LESS), "ab a-umlaut < ab sharp-s UTF-8 comparison failed");
153 doAssert((col->compare(abauIter, abssIter, success) == UCOL_LESS), "ab a-umlaut < ab sharp-s UCharIterator comparison failed");
158 doAssert((col->compare("ab", "abc", 2) == Collator::EQUAL), "ab = abc with length 2 comparison failed");
159 doAssert((col->compare("ab", "AB", 2) == Collator::LESS), "ab < AB with length 2 comparison failed");
160 doAssert((col->compare("ab", "Aa", 1) == Collator::LESS), "ab < Aa with length 1 comparison failed");
161 doAssert((col->compare("ab", "Aa", 2) == Collator::GREATER), "ab > Aa with length 2 comparison failed");
162 doAssert((col->compare("black-bird", "blackbird", 5) == Collator::EQUAL), "black-bird = blackbird with length of 5 comparison failed");
163 doAssert((col->compare("black bird", "black-bird", 10) == Collator::LESS), "black bird < black-bird with length 10 comparison failed");
164 doAssert((col->compare("Hello", "hello", 5) == Collator::GREATER), "Hello > hello with length 5 comparison failed");
170 doAssert((col->getStrength() == Collator::TERTIARY), "collation object has the wrong strength");
171 doAssert((col->getStrength() != Collator::PRIMARY), "collation object's strength is primary difference");
175 col->setStrength(Collator::SECONDARY);
176 doAssert((col->getStrength() != Collator::TERTIARY), "collation object's strength is secondary difference");
177 doAssert((col->getStrength() != Collator::PRIMARY), "collation object's strength is primary difference");
178 doAssert((col->getStrength() == Collator::SECONDARY), "collation object has the wrong strength");
196 delete col; col = 0;
209 col = Collator::createInstance(Locale::getFrench(), success);
216 col->setStrength(Collator::PRIMARY);
218 doAssert((col->getStrength() != Collator::TERTIARY), "collation object has the wrong strength");
219 doAssert((col->getStrength() == Collator::PRIMARY), "collation object's strength is not primary difference");
222 col->setStrength(Collator::TERTIARY);
223 doAssert((col->getStrength() == Collator::TERTIARY), "collation object's strength is not tertiary difference");
224 doAssert((col->getStrength() != Collator::PRIMARY), "collation object's strength is primary difference");
225 doAssert((col->getStrength() != Collator::SECONDARY), "collation object's strength is secondary difference");
236 delete col;
240 delete col;
241 col = Collator::createInstance(success);
249 doAssert(((RuleBasedCollator *)col)->getRules() == ((RuleBasedCollator *)junk)->getRules(),
255 delete col;
269 delete col;
286 col=Collator::createInstance(Locale(), versionArray, success);
289 delete col;
442 Collator *col;
465 col = someCollators[index]->safeClone();
466 if (col == 0) {
470 col->setStrength(Collator::TERTIARY);
472 col->setAttribute(UCOL_CASE_LEVEL, UCOL_OFF, err);
475 doAssert(col->greater(test1, test2), "Result should be \"abCda\" >>> \"abcda\" ");
477 delete col;
545 Collator *col = 0;
547 col = Collator::createInstance(Locale::getEnglish(), success);
553 col->setStrength(Collator::TERTIARY);
560 col->getCollationKey(NULL, 0, sortk1, key1Status);
568 col->getCollationKey(NULL, 0, sortk1, key1Status);
575 col->getCollationKey(test1, sortk1, key1Status);
576 doAssert((sortk1.compareTo(col->getCollationKey(test2, sortk2, key2Status)))
638 col->setStrength(Collator::SECONDARY);
639 doAssert(col->getCollationKey(test1, sortk1, key1Status).compareTo(
640 col->getCollationKey(test2, sortk2, key2Status))
643 delete col;
654 Collator *col = 0;
656 col = Collator::createInstance(Locale::getEnglish(), success);
666 CollationElementIterator *iterator1 = ((RuleBasedCollator*)col)->createCollationElementIterator(testString1);
669 CollationElementIterator *coliter=((RuleBasedCollator*)col)->createCollationElementIterator(*chariter);
672 CollationElementIterator *iterator2 = ((RuleBasedCollator*)col)->createCollationElementIterator(testString1);
673 CollationElementIterator *iterator3 = ((RuleBasedCollator*)col)->createCollationElementIterator(testString2);
836 delete col;
980 Collator *col = 0;
982 col = Collator::createInstance(Locale::getEnglish(), success);
990 doAssert((!col->equals(test1, test2) ), "Result should be \"Abcda\" != \"abcda\"");
991 doAssert((col->greater(test1, test2) ), "Result should be \"Abcda\" >>> \"abcda\"");
992 doAssert((col->greaterOrEqual(test1, test2) ), "Result should be \"Abcda\" >>> \"abcda\"");
994 col->setStrength(Collator::SECONDARY);
997 doAssert((col->equals(test1, test2) ), "Result should be \"Abcda\" == \"abcda\"");
998 doAssert((!col->greater(test1, test2) ), "Result should be \"Abcda\" == \"abcda\"");
999 doAssert((col->greaterOrEqual(test1, test2) ), "Result should be \"Abcda\" == \"abcda\"");
1001 col->setStrength(Collator::PRIMARY);
1004 doAssert((col->equals(test1, test2) ), "Result should be \"Abcda\" == \"abcda\"");
1005 doAssert((!col->greater(test1, test2) ), "Result should be \"Abcda\" == \"abcda\"");
1006 doAssert((col->greaterOrEqual(test1, test2) ), "Result should be \"Abcda\" == \"abcda\"");
1014 doAssert((col->compare(test1, test2) == Collator::EQUAL), "Problem");
1015 doAssert((col->compare(test1, test2, success) == UCOL_EQUAL), "Problem");
1016 doAssert((col->compare(t1, t1Len, t2, t2Len) == Collator::EQUAL), "Problem");
1017 doAssert((col->compare(t1, t1Len, t2, t2Len, success) == UCOL_EQUAL), "Problem");
1018 doAssert((col->compare(test1, test2, t1Len) == Collator::EQUAL), "Problem");
1019 doAssert((col->compare(test1, test2, t1Len, success) == UCOL_EQUAL), "Problem");
1021 col->setAttribute(UCOL_STRENGTH, UCOL_TERTIARY, success);
1022 doAssert((col->compare(test1, test2) == Collator::GREATER), "Problem");
1023 doAssert((col->compare(test1, test2, success) == UCOL_GREATER), "Problem");
1024 doAssert((col->compare(t1, t1Len, t2, t2Len) == Collator::GREATER), "Problem");
1025 doAssert((col->compare(t1, t1Len, t2, t2Len, success) == UCOL_GREATER), "Problem");
1026 doAssert((col->compare(test1, test2, t1Len) == Collator::GREATER), "Problem");
1027 doAssert((col->compare(test1, test2, t1Len, success) == UCOL_GREATER), "Problem");
1032 delete col;
1104 Collator *col = Collator::createInstance(Locale::getEnglish(), status);
1110 if (col->getStrength() != Collator::TERTIARY)
1116 col->setAttribute(UCOL_STRENGTH, UCOL_IDENTICAL, status);
1129 col->getCollationKey(test1, u_strlen(test1), key1, status);
1132 col->getCollationKey(test2, u_strlen(test2), key2, status);
1135 col->getCollationKey(test3, u_strlen(test3), key3, status);
1150 col->getSortKey(test1, sortkey1, 64);
1151 col->getSortKey(test2, sortkey2, 64);
1152 col->getSortKey(test3, sortkey3, 64);
1164 col->getSortKey(test1, 5, sortkey1, 64);
1165 col->getSortKey(test2, 5, sortkey2, 64);
1166 col->getSortKey(test3, 5, sortkey3, 64);
1179 col->getSortKey(strtest1, sortkey1, 64);
1181 col->getSortKey(strtest2, sortkey2, 64);
1183 col->getSortKey(strtest3, sortkey3, 64);
1196 col->setStrength(Collator::SECONDARY);
1198 col->getCollationKey(test1, u_strlen(test1), key1, status);
1199 col->getCollationKey(test2, u_strlen(test2), key2, status);
1200 col->getCollationKey(test3, u_strlen(test3), key3, status);
1211 col->getSortKey(test1, sortkey1, 64);
1212 col->getSortKey(test2, sortkey2, 64);
1213 col->getSortKey(test3, sortkey3, 64);
1225 col->getSortKey(test1, 5, sortkey1, 64);
1226 col->getSortKey(test2, 5, sortkey2, 64);
1227 col->getSortKey(test3, 5, sortkey3, 64);
1239 col->getSortKey(strtest1, sortkey1, 64);
1240 col->getSortKey(strtest2, sortkey2, 64);
1241 col->getSortKey(strtest3, sortkey3, 64);
1254 delete col;
1259 LocalPointer<Collator> col(Collator::createInstance(Locale::getEnglish(), errorCode));
1263 col->setAttribute(UCOL_STRENGTH, UCOL_PRIMARY, errorCode);
1269 int32_t length = col->getSortKey(i_and_phi, 2, sortKey, LENGTHOF(sortKey));
1273 int32_t length2 = col->getSortKey(i_and_phi, 2, sortKey2, capacity);
1292 length = col->getSortKey(s, longSortKey.getAlias(), longCapacity);
1294 col->getCollationKey(s, collKey, errorCode);