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;
202 col = Collator::createInstance(Locale::getFrench(), success);
209 col->setStrength(Collator::PRIMARY);
211 doAssert((col->getStrength() != Collator::TERTIARY), "collation object has the wrong strength");
212 doAssert((col->getStrength() == Collator::PRIMARY), "collation object's strength is not primary difference");
215 col->setStrength(Collator::TERTIARY);
216 doAssert((col->getStrength() == Collator::TERTIARY), "collation object's strength is not tertiary difference");
217 doAssert((col->getStrength() != Collator::PRIMARY), "collation object's strength is primary difference");
218 doAssert((col->getStrength() != Collator::SECONDARY), "collation object's strength is secondary difference");
229 delete col;
233 delete col;
234 col = Collator::createInstance(success);
242 doAssert(((RuleBasedCollator *)col)->getRules() == ((RuleBasedCollator *)junk)->getRules(),
248 delete col;
262 delete col;
279 col=Collator::createInstance(Locale(), versionArray, success);
282 delete col;
435 Collator *col;
458 col = someCollators[index]->safeClone();
459 if (col == 0) {
463 col->setStrength(Collator::TERTIARY);
465 col->setAttribute(UCOL_CASE_LEVEL, UCOL_OFF, err);
468 doAssert(col->greater(test1, test2), "Result should be \"abCda\" >>> \"abcda\" ");
470 delete col;
538 Collator *col = 0;
540 col = Collator::createInstance(Locale::getEnglish(), success);
546 col->setStrength(Collator::TERTIARY);
553 col->getCollationKey(NULL, 0, sortk1, key1Status);
561 col->getCollationKey(NULL, 0, sortk1, key1Status);
568 col->getCollationKey(test1, sortk1, key1Status);
569 doAssert((sortk1.compareTo(col->getCollationKey(test2, sortk2, key2Status)))
631 col->setStrength(Collator::SECONDARY);
632 doAssert(col->getCollationKey(test1, sortk1, key1Status).compareTo(
633 col->getCollationKey(test2, sortk2, key2Status))
636 delete col;
647 Collator *col = 0;
649 col = Collator::createInstance(Locale::getEnglish(), success);
659 CollationElementIterator *iterator1 = ((RuleBasedCollator*)col)->createCollationElementIterator(testString1);
662 CollationElementIterator *coliter=((RuleBasedCollator*)col)->createCollationElementIterator(*chariter);
665 CollationElementIterator *iterator2 = ((RuleBasedCollator*)col)->createCollationElementIterator(testString1);
666 CollationElementIterator *iterator3 = ((RuleBasedCollator*)col)->createCollationElementIterator(testString2);
829 delete col;
973 Collator *col = 0;
975 col = Collator::createInstance(Locale::getEnglish(), success);
983 doAssert((!col->equals(test1, test2) ), "Result should be \"Abcda\" != \"abcda\"");
984 doAssert((col->greater(test1, test2) ), "Result should be \"Abcda\" >>> \"abcda\"");
985 doAssert((col->greaterOrEqual(test1, test2) ), "Result should be \"Abcda\" >>> \"abcda\"");
987 col->setStrength(Collator::SECONDARY);
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::PRIMARY);
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\"");
1007 doAssert((col->compare(test1, test2) == Collator::EQUAL), "Problem");
1008 doAssert((col->compare(test1, test2, success) == UCOL_EQUAL), "Problem");
1009 doAssert((col->compare(t1, t1Len, t2, t2Len) == Collator::EQUAL), "Problem");
1010 doAssert((col->compare(t1, t1Len, t2, t2Len, success) == UCOL_EQUAL), "Problem");
1011 doAssert((col->compare(test1, test2, t1Len) == Collator::EQUAL), "Problem");
1012 doAssert((col->compare(test1, test2, t1Len, success) == UCOL_EQUAL), "Problem");
1014 col->setAttribute(UCOL_STRENGTH, UCOL_TERTIARY, success);
1015 doAssert((col->compare(test1, test2) == Collator::GREATER), "Problem");
1016 doAssert((col->compare(test1, test2, success) == UCOL_GREATER), "Problem");
1017 doAssert((col->compare(t1, t1Len, t2, t2Len) == Collator::GREATER), "Problem");
1018 doAssert((col->compare(t1, t1Len, t2, t2Len, success) == UCOL_GREATER), "Problem");
1019 doAssert((col->compare(test1, test2, t1Len) == Collator::GREATER), "Problem");
1020 doAssert((col->compare(test1, test2, t1Len, success) == UCOL_GREATER), "Problem");
1025 delete col;
1097 Collator *col = Collator::createInstance(Locale::getEnglish(), status);
1103 if (col->getStrength() != Collator::TERTIARY)
1109 col->setAttribute(UCOL_STRENGTH, UCOL_IDENTICAL, status);
1122 col->getCollationKey(test1, u_strlen(test1), key1, status);
1125 col->getCollationKey(test2, u_strlen(test2), key2, status);
1128 col->getCollationKey(test3, u_strlen(test3), key3, status);
1143 col->getSortKey(test1, sortkey1, 64);
1144 col->getSortKey(test2, sortkey2, 64);
1145 col->getSortKey(test3, sortkey3, 64);
1157 col->getSortKey(test1, 5, sortkey1, 64);
1158 col->getSortKey(test2, 5, sortkey2, 64);
1159 col->getSortKey(test3, 5, sortkey3, 64);
1172 col->getSortKey(strtest1, sortkey1, 64);
1174 col->getSortKey(strtest2, sortkey2, 64);
1176 col->getSortKey(strtest3, sortkey3, 64);
1189 col->setStrength(Collator::SECONDARY);
1191 col->getCollationKey(test1, u_strlen(test1), key1, status);
1192 col->getCollationKey(test2, u_strlen(test2), key2, status);
1193 col->getCollationKey(test3, u_strlen(test3), key3, status);
1204 col->getSortKey(test1, sortkey1, 64);
1205 col->getSortKey(test2, sortkey2, 64);
1206 col->getSortKey(test3, sortkey3, 64);
1218 col->getSortKey(test1, 5, sortkey1, 64);
1219 col->getSortKey(test2, 5, sortkey2, 64);
1220 col->getSortKey(test3, 5, sortkey3, 64);
1232 col->getSortKey(strtest1, sortkey1, 64);
1233 col->getSortKey(strtest2, sortkey2, 64);
1234 col->getSortKey(strtest3, sortkey3, 64);
1247 delete col;
1252 LocalPointer<Collator> col(Collator::createInstance(Locale::getEnglish(), errorCode));
1256 col->setAttribute(UCOL_STRENGTH, UCOL_PRIMARY, errorCode);
1262 int32_t length = col->getSortKey(i_and_phi, 2, sortKey, LENGTHOF(sortKey));
1266 int32_t length2 = col->getSortKey(i_and_phi, 2, sortKey2, capacity);
1285 length = col->getSortKey(s, longSortKey.getAlias(), longCapacity);
1287 col->getCollationKey(s, collKey, errorCode);