mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-13 17:01:16 +00:00
ICU-96 review and fix failing tests
X-SVN-Rev: 4050
This commit is contained in:
parent
74d6a0d6b6
commit
8b48bed373
6 changed files with 36 additions and 25 deletions
|
@ -339,7 +339,7 @@ const UChar testTargetCases[][16] = {
|
|||
|
||||
const UCollationResult results[] = {
|
||||
UCOL_LESS,
|
||||
UCOL_GREATER,
|
||||
UCOL_LESS, /*UCOL_GREATER,*/
|
||||
UCOL_LESS,
|
||||
UCOL_LESS,
|
||||
UCOL_LESS,
|
||||
|
@ -643,8 +643,10 @@ static void TestJB581(void)
|
|||
UCollator *myCollator = 0;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
u_uastrcpy(source, "This is a test.");
|
||||
u_uastrcpy(target, "THISISATEST.");
|
||||
/*u_uastrcpy(source, "This is a test.");*/
|
||||
/*u_uastrcpy(target, "THISISATEST.");*/
|
||||
u_uastrcpy(source, "THISISATEST.");
|
||||
u_uastrcpy(target, "Thisisatest.");
|
||||
|
||||
myCollator = ucol_open("en_US", &status);
|
||||
if (U_FAILURE(status)){
|
||||
|
|
|
@ -33,7 +33,7 @@ void addCollAPITest(TestNode** root)
|
|||
addTest(root, &TestCompare, "tscoll/capitst/TestCompare");
|
||||
addTest(root, &TestSortKey, "tscoll/capitst/TestSortKey");
|
||||
addTest(root, &TestHashCode, "tscoll/capitst/TestHashCode");
|
||||
/*addTest(root, &TestElemIter, "tscoll/capitst/TestElemIter");*/
|
||||
addTest(root, &TestElemIter, "tscoll/capitst/TestElemIter");
|
||||
addTest(root, &TestGetAll, "tscoll/capitst/TestGetAll");
|
||||
/*addTest(root, &TestGetDefaultRules, "tscoll/capitst/TestGetDefaultRules");*/
|
||||
addTest(root, &TestDecomposition, "tscoll/capitst/TestDecomposition");
|
||||
|
@ -155,8 +155,11 @@ void TestProperty()
|
|||
u_uastrcpy(target, "AB");
|
||||
|
||||
doAssert((ucol_strcoll(col, source, u_strlen(source), target, u_strlen(target)) == UCOL_LESS), "ab < AB comparison failed");
|
||||
u_uastrcpy(source, "black-bird");
|
||||
u_uastrcpy(target, "blackbird");
|
||||
/* u_uastrcpy(source, "black-bird");
|
||||
u_uastrcpy(target, "blackbird"); */
|
||||
u_uastrcpy(target, "black-bird");
|
||||
u_uastrcpy(source, "blackbird");
|
||||
|
||||
doAssert((ucol_strcoll(col, source, u_strlen(source), target, u_strlen(target)) == UCOL_GREATER),
|
||||
"black-bird > blackbird comparison failed");
|
||||
u_uastrcpy(source, "black bird");
|
||||
|
@ -527,7 +530,10 @@ void TestSortKey()
|
|||
{
|
||||
uint8_t *sortk1 = NULL, *sortk2 = NULL, *sortk3 = NULL;
|
||||
uint8_t sortk2_compat[] = {
|
||||
0x02, 0x54, 0x02, 0x55, 0x02, 0x56, 0x02, 0x57, 0x02, 0x54, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x00
|
||||
/*this is a 1.8 sortkey */
|
||||
0x17, 0x19, 0x1B, 0x1D, 0x17, 0x01, 0x08, 0x01, 0x08, 0x00
|
||||
/*this is a 1.7 sortkey */
|
||||
/*0x02, 0x54, 0x02, 0x55, 0x02, 0x56, 0x02, 0x57, 0x02, 0x54, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x00*/
|
||||
/* this is a 1.6 sortkey */
|
||||
/*0x00, 0x53, 0x00, 0x54, 0x00, 0x55, 0x00, 0x56, 0x00, 0x53, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00*/
|
||||
};
|
||||
|
|
|
@ -161,7 +161,7 @@ typedef struct {
|
|||
const UChar *end;
|
||||
} testContext;
|
||||
|
||||
UChar testInc(void *context) {
|
||||
UChar U_CALLCONV testInc(void *context) {
|
||||
testContext *s = (testContext *)context;
|
||||
if(s->start == s->end) {
|
||||
return 0xFFFF;
|
||||
|
|
|
@ -66,13 +66,13 @@ const static UCollationResult results[] =
|
|||
{
|
||||
UCOL_LESS,
|
||||
UCOL_LESS,
|
||||
UCOL_GREATER,
|
||||
UCOL_LESS, /*UCOL_GREATER,*/
|
||||
UCOL_LESS,
|
||||
UCOL_GREATER,
|
||||
UCOL_GREATER,
|
||||
UCOL_LESS,
|
||||
UCOL_GREATER,
|
||||
UCOL_GREATER,
|
||||
UCOL_LESS, /*UCOL_GREATER,*/
|
||||
UCOL_GREATER,
|
||||
UCOL_LESS,
|
||||
UCOL_LESS
|
||||
|
|
|
@ -61,8 +61,8 @@ const char* locales[8] = {
|
|||
|
||||
|
||||
const static UChar testCases[][MAX_TOKEN_LEN] = {
|
||||
{ 0x0062 /*'b'*/, 0x006c /*'l'*/, 0x0061 /*'a'*/, 0x0062 /*'c'*/, 0x006b /*'k'*/,
|
||||
0x002d /*'-'*/, 0x0062 /*'b'*/, 0x0069 /*'i'*/, 0x0072 /*'r'*/, 0x0064 /*'d'*/, 0x0073/*'s'*/, 0x0000}, /* 0 */
|
||||
{ 0x0062 /*'b'*/, 0x006c /*'l'*/, 0x0061 /*'a'*/, 0x0062 /*'c'*/, 0x006b /*'k'*/,
|
||||
0x0062 /*'b'*/, 0x0069 /*'i'*/, 0x0072 /*'r'*/, 0x0064 /*'d'*/, 0x0073 /*'s'*/, 0x0000}, /* 9 */
|
||||
{ 0x0050 /*'P'*/, 0x0061 /*'a'*/, 0x0074/*'t'*/, 0x0000}, /* 1 */
|
||||
{ 0x0070 /*'p'*/, 0x00E9, 0x0063 /*'c'*/, 0x0068 /*'h'*/, 0x00E9, 0x0000}, /* 2 */
|
||||
{ 0x0070 /*'p'*/, 0x00EA, 0x0063 /*'c'*/, 0x0068 /*'h'*/, 0x0065 /*'e'*/, 0x0000}, /* 3 */
|
||||
|
@ -71,14 +71,14 @@ const static UChar testCases[][MAX_TOKEN_LEN] = {
|
|||
{ 0x0054 /*'T'*/, 0x006f /*'o'*/, 0x0064 /*'d'*/, 0x0000}, /* 6 */
|
||||
{ 0x0054 /*'T'*/, 0x00F6, 0x006e /*'n'*/, 0x0065 /*'e'*/, 0x0000}, /* 7 */
|
||||
{ 0x0054 /*'T'*/, 0x006f /*'o'*/, 0x0066 /*'f'*/, 0x0075 /*'u'*/, 0x0000}, /* 8 */
|
||||
{ 0x0062 /*'b'*/, 0x006c /*'l'*/, 0x0061 /*'a'*/, 0x0062 /*'c'*/, 0x006b /*'k'*/,
|
||||
0x0062 /*'b'*/, 0x0069 /*'i'*/, 0x0072 /*'r'*/, 0x0064 /*'d'*/, 0x0073 /*'s'*/, 0x0000}, /* 9 */
|
||||
{ 0x0062 /*'b'*/, 0x006c /*'l'*/, 0x0061 /*'a'*/, 0x0062 /*'c'*/, 0x006b /*'k'*/,
|
||||
0x0062 /*'b'*/, 0x0069 /*'i'*/, 0x0072 /*'r'*/, 0x0064 /*'d'*/, 0x0000}, /* 12 */
|
||||
{ 0x0054 /*'T'*/, 0x006f /*'o'*/, 0x006e /*'n'*/, 0x0000}, /* 10 */
|
||||
{ 0x0050 /*'P'*/, 0x0041 /*'A'*/, 0x0054 /*'T'*/, 0x0000}, /* 11 */
|
||||
{ 0x0062 /*'b'*/, 0x006c /*'l'*/, 0x0061 /*'a'*/, 0x0062 /*'c'*/, 0x006b /*'k'*/,
|
||||
0x0062 /*'b'*/, 0x0069 /*'i'*/, 0x0072 /*'r'*/, 0x0064 /*'d'*/, 0x0000}, /* 12 */
|
||||
{ 0x0062 /*'b'*/, 0x006c /*'l'*/, 0x0061 /*'a'*/, 0x0062 /*'c'*/, 0x006b /*'k'*/,
|
||||
0x002d /*'-'*/, 0x0062 /*'b'*/, 0x0069 /*'i'*/, 0x0072 /*'r'*/, 0x0064 /*'d'*/, 0x0000}, /* 13 */
|
||||
{ 0x0062 /*'b'*/, 0x006c /*'l'*/, 0x0061 /*'a'*/, 0x0062 /*'c'*/, 0x006b /*'k'*/,
|
||||
0x002d /*'-'*/, 0x0062 /*'b'*/, 0x0069 /*'i'*/, 0x0072 /*'r'*/, 0x0064 /*'d'*/, 0x0073/*'s'*/, 0x0000}, /* 0 */
|
||||
{0x0070 /*'p'*/, 0x0061 /*'a'*/, 0x0074 /*'t'*/, 0x0000}, /* 14 */
|
||||
/* Additional tests */
|
||||
{ 0x0063 /*'c'*/, 0x007a /*'z'*/, 0x0061 /*'a'*/, 0x0072 /*'r'*/, 0x0000 }, /* 15 */
|
||||
|
@ -89,14 +89,14 @@ const static UChar testCases[][MAX_TOKEN_LEN] = {
|
|||
{ 0x0071 /*'q'*/, 0x0075 /*'u'*/, 0x0069 /*'i'*/, 0x0063 /*'c'*/, 0x006b /*'k'*/, 0x0000 }, /* 20 */
|
||||
{ 0x0023 /*'#'*/, 0x0000 }, /* 21 */
|
||||
{ 0x0026 /*'&'*/, 0x0000 }, /* 22 */
|
||||
{ 0x0061 /*'a'*/, 0x0061 /*'a'*/, 0x0072 /*'r'*/, 0x0064 /*'d'*/, 0x0076 /*'v'*/, 0x0061 /*'a'*/,
|
||||
0x0072/*'r'*/, 0x006b/*'k'*/, 0x0000}, /* 23 */
|
||||
{ 0x0061 /*'a'*/, 0x002d /*'-'*/, 0x0072 /*'r'*/, 0x0064 /*'d'*/, 0x0076 /*'v'*/, 0x0061 /*'a'*/,
|
||||
0x0072/*'r'*/, 0x006b/*'k'*/, 0x0000}, /* 24 */
|
||||
{ 0x0061 /*'a'*/, 0x0061 /*'a'*/, 0x0072 /*'r'*/, 0x0064 /*'d'*/, 0x0076 /*'v'*/, 0x0061 /*'a'*/,
|
||||
0x0072/*'r'*/, 0x006b/*'k'*/, 0x0000}, /* 23 */
|
||||
{ 0x0061 /*'a'*/, 0x0062 /*'b'*/, 0x0062 /*'b'*/, 0x006f /*'o'*/, 0x0074 /*'t'*/, 0x0000}, /* 25 */
|
||||
{ 0x0063 /*'c'*/, 0x006f /*'o'*/, 0x006f /*'o'*/, 0x0070 /*'p'*/, 0x0000}, /* 26 */
|
||||
{ 0x0063 /*'c'*/, 0x006f /*'o'*/, 0x002d /*'-'*/, 0x0070 /*'p'*/, 0x0000}, /* 27 */
|
||||
{ 0x0063 /*'c'*/, 0x006f /*'o'*/, 0x0070 /*'p'*/, 0x0000}, /* 28 */
|
||||
{ 0x0063 /*'c'*/, 0x006f /*'o'*/, 0x006f /*'o'*/, 0x0070 /*'p'*/, 0x0000}, /* 26 */
|
||||
{ 0x007a /*'z'*/, 0x0065 /*'e'*/, 0x0062 /*'b'*/, 0x0072 /*'r'*/, 0x0061 /*'a'*/, 0x0000} /* 29 */
|
||||
};
|
||||
|
||||
|
@ -112,11 +112,11 @@ const static int32_t results[TESTLOCALES][TOTALTESTSET] = {
|
|||
/* new table collation with rules "& Z < p, P" loop to FIXEDTESTSET */
|
||||
{ 12, 13, 9, 0, 6, 8, 10, 7, 14, 1, 11, 2, 3, 4, 5, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31 },
|
||||
/* new table collation with rules "& C < ch , cH, Ch, CH " loop to TOTALTESTSET */
|
||||
{ 19, 22, 21, 23, 25, 24, 12, 13, 9, 0, 17, 26, 28, 27, 15, 16, 18, 14, 1, 11, 2, 3, 4, 5, 20, 6, 8, 10, 7, 29 },
|
||||
{ 19, 22, 21, 23, 24, 25, 12, 13, 9, 0, 17, 26, 28, 27, 15, 16, 18, 14, 1, 11, 2, 3, 4, 5, 20, 6, 8, 10, 7, 29 },
|
||||
/* new table collation with rules "& Question-mark ; ? & Hash-mark ; # & Ampersand ; '&' " loop to TOTALTESTSET */
|
||||
{ 23, 25, 22, 24, 12, 13, 9, 0, 17, 16, 26, 28, 27, 15, 18, 21, 14, 1, 11, 2, 3, 4, 5, 19, 20, 6, 8, 10, 7, 29 },
|
||||
{ 23, 24, 25, 22, 12, 13, 9, 0, 17, 16, 26, 28, 27, 15, 18, 21, 14, 1, 11, 2, 3, 4, 5, 19, 20, 6, 8, 10, 7, 29 },
|
||||
/* analogous to Japanese rules " & aa ; a- & ee ; e- & ii ; i- & oo ; o- & uu ; u- " */ /* loop to TOTALTESTSET */
|
||||
{ 19, 22, 21, 23, 24, 25, 12, 13, 9, 0, 17, 16, 26, 27, 28, 15, 18, 14, 1, 11, 2, 3, 4, 5, 20, 6, 8, 10, 7, 29 }
|
||||
{ 19, 22, 21, 23, 24, 25, 12, 13, 9, 0, 17, 16, 26, 28, 27, 15, 18, 14, 1, 11, 2, 3, 4, 5, 20, 6, 8, 10, 7, 29 }
|
||||
};
|
||||
|
||||
static UChar*
|
||||
|
@ -172,6 +172,9 @@ static void TestG7Locales()
|
|||
{
|
||||
status = U_ZERO_ERROR;
|
||||
myCollation = ucol_open(locales[i], &status);
|
||||
ucol_setAttribute(myCollation, UCOL_STRENGTH, UCOL_QUATERNARY, &status);
|
||||
ucol_setAttribute(myCollation, UCOL_ALTERNATE_HANDLING, UCOL_SHIFTED, &status);
|
||||
|
||||
if (U_FAILURE(status))
|
||||
{
|
||||
log_err("Error in creating collator in %s: %s\n", locales[i], myErrorName(status));
|
||||
|
|
|
@ -136,7 +136,7 @@ const static UChar testTargetCases[][MAX_TOKEN_LEN] = {
|
|||
|
||||
const static UCollationResult results[] = {
|
||||
UCOL_LESS,
|
||||
UCOL_GREATER,
|
||||
UCOL_LESS, /*UCOL_GREATER,*/
|
||||
UCOL_LESS,
|
||||
UCOL_GREATER,
|
||||
UCOL_GREATER,
|
||||
|
@ -144,7 +144,7 @@ const static UCollationResult results[] = {
|
|||
UCOL_LESS,
|
||||
UCOL_LESS,
|
||||
UCOL_LESS,
|
||||
UCOL_GREATER, /* 10 */
|
||||
UCOL_LESS, /*UCOL_GREATER,*/ /* 10 */
|
||||
UCOL_GREATER,
|
||||
UCOL_LESS,
|
||||
UCOL_EQUAL,
|
||||
|
@ -236,9 +236,9 @@ const static UChar testAcute[][MAX_TOKEN_LEN] = {
|
|||
|
||||
static const UChar testMore[][MAX_TOKEN_LEN] = {
|
||||
{(UChar)0x0061 /* 'a' */, (UChar)0x0065 /* 'e' */, 0},
|
||||
{(UChar)0x0061 /* 'a' */, (UChar)0x0066 /* 'f' */, 0},
|
||||
{ 0x00E6, 0},
|
||||
{ 0x00C6, 0},
|
||||
{(UChar)0x0061 /* 'a' */, (UChar)0x0066 /* 'f' */, 0},
|
||||
{(UChar)0x006F /* 'o' */, (UChar)0x0065 /* 'e' */, 0},
|
||||
{ 0x0153, 0},
|
||||
{ 0x0152, 0},
|
||||
|
|
Loading…
Add table
Reference in a new issue