ICU-4350 Update intltest with UCA 4.1 changes

X-SVN-Rev: 17624
This commit is contained in:
Vladimir Weinstein 2005-05-19 06:46:30 +00:00
parent e8b9a1e903
commit 67be180f3d
3 changed files with 17 additions and 6 deletions

View File

@ -1018,11 +1018,17 @@ void CollationAPITest::TestSortKey()
col->setAttribute(UCOL_STRENGTH, UCOL_IDENTICAL, status);
uint8_t key2compat[] = {
/* 3.4 key, from UCA 4.1 */
0x28, 0x2a, 0x2c, 0x2e, 0x28, 0x01,
0x09, 0x01, 0x09, 0x01, 0x27, 0x01,
0x92, 0x93, 0x94, 0x95, 0x92, 0x00
/* 2.6.1 key */
/*
0x26, 0x28, 0x2A, 0x2C, 0x26, 0x01,
0x09, 0x01, 0x09, 0x01, 0x25, 0x01,
0x92, 0x93, 0x94, 0x95, 0x92, 0x00
*/
/* 2.2 key */
/*
0x1D, 0x1F, 0x21, 0x23, 0x1D, 0x01,

View File

@ -412,8 +412,9 @@ void CollationThaiTest::TestReordering(void) {
"\\u0E41\\uD87E\\uDC02", "=", "\\u0E41\\u4E41", // supplementary composition decomps to BMP
"\\u0E41\\u0301", "=", "\\u0E41\\u0301", // unsafe (just checking backwards iteration)
"\\u0E41\\u0301\\u0316", "=", "\\u0E41\\u0316\\u0301",
"\\u0e24\\u0e41", "=", "\\u0e41\\u0e24", // exiting contraction bug
"\\u0e3f\\u0e3f\\u0e24\\u0e41", "=", "\\u0e3f\\u0e3f\\u0e41\\u0e24",
// after UCA 4.1, the two lines below are not equal anymore do not have equal sign
"\\u0e24\\u0e41", "<", "\\u0e41\\u0e24", // exiting contraction bug
"\\u0e3f\\u0e3f\\u0e24\\u0e41", "<", "\\u0e3f\\u0e3f\\u0e41\\u0e24",
"abc\\u0E41c\\u0301", "=", "abc\\u0E41\\u0107", // composition
"abc\\u0E41\\uD834\\uDC00", "<", "abc\\u0E41\\uD834\\uDC01", // supplementaries
@ -440,7 +441,7 @@ void CollationThaiTest::TestReordering(void) {
compareArray(*coll, tests, sizeof(tests)/sizeof(tests[0]));
const char *rule = "& c < ab";
const char *testcontraction[] = { "\\u0E41ab", "<", "\\u0E41c"};
const char *testcontraction[] = { "\\u0E41ab", ">", "\\u0E41c"}; // After UCA 4.1 Thai are normal so won't break a contraction
UnicodeString rules;
UErrorCode status = U_ZERO_ERROR;
parseChars(rules, rule);

View File

@ -169,13 +169,14 @@ void UCAConformanceTest::testConformance(UCollator *coll)
int32_t buflen = 0, oldBlen = 0;
uint32_t first = 0;
uint32_t offset = 0;
UnicodeString oldS, newS;
while (fgets(lineB, 1024, testFile) != NULL) {
offset = 0;
line++;
if(*lineB == 0 || lineB[0] == '#') {
if(*lineB == 0 || strlen(lineB) < 3 || lineB[0] == '#') {
continue;
}
offset = u_parseString(lineB, buffer, 1024, &first, &status);
@ -203,6 +204,9 @@ void UCAConformanceTest::testConformance(UCollator *coll)
if(res > 0) {
errln("Line %i is not greater or equal than previous line", line);
logln("Data line %s", lineB);
prettify(CollationKey(oldSk, oldLen), oldS);
prettify(CollationKey(newSk, resLen), newS);
logln("Keys: "+oldS+" and "+newS);
} else if(res == 0) { /* equal */
res = u_strcmpCodePointOrder(oldB, buffer);
if (res == 0) {