Synched up japanese test getTertiary

X-SVN-Rev: 4129
This commit is contained in:
Syn Wee Quek 2001-03-16 03:04:37 +00:00
parent 57da770f26
commit 1cbcabf647

View File

@ -47,45 +47,30 @@ CollationKanaTest::~CollationKanaTest()
}
const UChar CollationKanaTest::testSourceCases[][CollationKanaTest::MAX_TOKEN_LEN] = {
{0x41, 0x0300, 0x0301, 0},
{0x41, 0x0300, 0x0316, 0},
{0x41, 0x0300, 0},
{0x00C0, 0x0301, 0},
{0x00C0, 0x0316, 0},
{0xff9E, 0},
{0x3042, 0},
{0x30A2, 0},
{0x3042, 0x3042, 0},
{0x30A2, 0x30FC, 0},
{0x30A2, 0x30FC, 0x30C8, 0} // 11
{0xff9E, 0x0000},
{0x3042, 0x0000},
{0x30A2, 0x0000},
{0x3042, 0x3042, 0x0000},
{0x30A2, 0x30FC, 0x0000},
{0x30A2, 0x30FC, 0x30C8, 0x0000} /* 6 */
};
const UChar CollationKanaTest::testTargetCases[][CollationKanaTest::MAX_TOKEN_LEN] = {
{0x41, 0x0301, 0x0300, 0},
{0x41, 0x0316, 0x0300, 0},
{0x00C0, 0},
{0x41, 0x0301, 0x0300, 0},
{0x41, 0x0316, 0x0300, 0},
{0xFF9F, 0},
{0x30A2, 0},
{0x3042, 0x3042, 0},
{0x30A2, 0x30FC, 0},
{0x30A2, 0x30FC, 0x30C8, 0},
{0x3042, 0x3042, 0x3089, 0} // 11
{0xFF9F, 0x0000},
{0x30A2, 0x0000},
{0x3042, 0x3042, 0x0000},
{0x30A2, 0x30FC, 0x0000},
{0x30A2, 0x30FC, 0x30C8, 0x0000},
{0x3042, 0x3042, 0x3068, 0x0000} /* 6 */
};
const Collator::EComparisonResult CollationKanaTest::results[] = {
Collator::GREATER,
Collator::EQUAL,
Collator::EQUAL,
Collator::GREATER,
Collator::EQUAL,
Collator::LESS,
Collator::GREATER,
Collator::LESS,
Collator::GREATER,
Collator::LESS,
Collator::LESS // 11
Collator::LESS,
Collator::LESS,
Collator::GREATER
};
void CollationKanaTest::doTest( UnicodeString source, UnicodeString target, Collator::EComparisonResult result)
@ -109,8 +94,13 @@ void CollationKanaTest::doTest( UnicodeString source, UnicodeString target, Coll
void CollationKanaTest::TestTertiary(/* char* par */)
{
int32_t i = 0;
UErrorCode status = U_ZERO_ERROR;
myCollation->setStrength(Collator::TERTIARY);
for (i = 0; i < 11; i++) {
/* for one case, strcollinc fails, since it doesn't have good handling of contractions*/
/* normalization is turned off to stop strcollinc from executing */
myCollation->setAttribute(UCOL_NORMALIZATION_MODE, UCOL_ON, status);
myCollation->setAttribute(UCOL_CASE_LEVEL, UCOL_ON, status);
for (i = 0; i < 6; i++) {
doTest(testSourceCases[i], testTargetCases[i], results[i]);
}
}