void doTest(UCollator* myCollation, const UChar source[], const UChar target[], UCollationResult result) { if(myCollation) { doTestVariant(myCollation, source, target, result); if(result == UCOL_LESS) { doTestVariant(myCollation, target, source, UCOL_GREATER); } else if(result == UCOL_GREATER) { doTestVariant(myCollation, target, source, UCOL_LESS); } else { doTestVariant(myCollation, target, source, UCOL_EQUAL); } } else { log_data_err("No collator! Any data around?\n"); } }
void IntlTestCollator::doTest(Collator* col, const UnicodeString &source, const UnicodeString &target, Collator::EComparisonResult result) { if(col) { doTestVariant(col, source, target, result); if(result == Collator::LESS) { doTestVariant(col, target, source, Collator::GREATER); } else if (result == Collator::GREATER) { doTestVariant(col, target, source, Collator::LESS); } UErrorCode status = U_ZERO_ERROR; LocalPointer<CollationElementIterator> c(((RuleBasedCollator *)col)->createCollationElementIterator(source)); logln("Testing iterating source: "+source); backAndForth(*c); c->setText(target, status); logln("Testing iterating target: "+target); backAndForth(*c); } }