From 71c2e432b3815744465a3c59a86f84ceee2f9a12 Mon Sep 17 00:00:00 2001 From: Vladimir Weinstein Date: Thu, 13 Jun 2002 18:35:27 +0000 Subject: [PATCH] ICU-1930 updated tests for the new UCA (some of them still fail, pending new data files) X-SVN-Rev: 8883 --- icu4c/source/test/cintltst/callcoll.c | 20 +++-- icu4c/source/test/cintltst/capitst.c | 17 +++- icu4c/source/test/cintltst/citertst.c | 10 ++- icu4c/source/test/cintltst/cmsccoll.c | 120 ++++++++++++++++++++++++-- 4 files changed, 145 insertions(+), 22 deletions(-) diff --git a/icu4c/source/test/cintltst/callcoll.c b/icu4c/source/test/cintltst/callcoll.c index 9cf9efeb6c7..95c60d240e1 100644 --- a/icu4c/source/test/cintltst/callcoll.c +++ b/icu4c/source/test/cintltst/callcoll.c @@ -684,12 +684,14 @@ static void TestVariableTop(void) } /** -* Tests surrogate support. -*/ + * Tests surrogate support. + * NOTE: This test used \\uD801\\uDC01 pair, which is now assigned to Desseret + * Therefore, another (unassigned) code point was used for this test. + */ static void TestSurrogates(void) { const char *str = - "&z<'\\uD800\\uDC00'<'\\uD801\\uDC01\\u0308'image + coll->image->contractionUCACombos); + UChar *conts = (UChar *)((uint8_t *)coll->image + coll->image->UCAConsts+sizeof(UCAConstants)); + /*UChar *conts = (UChar *)((uint8_t *)coll->image + coll->image->contractionUCACombos);*/ while(*conts != 0) { if(*(conts+2) == 0) { varTop1 = ucol_setVariableTop(coll, conts, -1, &status); @@ -3489,9 +3500,102 @@ static void TestRuleOptions(void) { } } +static void TestIgnorableShifted(void) { +#if 0 +Mark a b +Mark vs +Mark A b +Mark I think those should differ. +weiv these should be equal when shifted but different when non ignorable, right +weiv except capital A would sort after lower case a +Mark OLD implementation: IGNOREABLE: #1 > #2 +Mark NEW implemenation: IGNOREABLE: #2 > #1 +Mark NON-IGNOREABLE: #1 > #2 +"ab","Ab","ab","Ab","a\\0300b","Ab" +"A\\u300b","ab","Ab","ab","Ab" +#endif + static struct { + const char *data[50]; + const uint32_t len; + const UColAttribute att[2]; + const UColAttribute value[2]; + } tests[] = { + { + { "a \\u0300b", "a b", "A \\u0300b", "A b", "a\\u0300b", "A\\u0300b"}, 5, + { UCOL_ALTERNATE_HANDLING, UCOL_STRENGTH }, { UCOL_SHIFTED, UCOL_QUATERNARY } + }, + { + {"a b", "A b", "a \\u0300b", "A \\u0300b", "a\\u0300b", "A\\u0300b"}, 6, + { UCOL_ALTERNATE_HANDLING, UCOL_STRENGTH }, { UCOL_NON_IGNORABLE, UCOL_TERTIARY } + }, + { + { +#if 0 + "ab", + "Ab", + "ab", + "Ab", + "ab", + "Ab" + "ab", + "Ab", + "ab", + "Ab", + "ab", + "Ab" + "ab", + "Ab", + "ab", + "Ab", + "ab", + "Ab" + "ab", + "Ab", + "ab", + "Ab", + "ab", + "Ab" +#endif + "a b", + "A b", + "a \\u0300b", + "A \\u0300b", + "a\\u0300b", + "A\\u0300b", + "a\\u005fb", + "A\\u005fb", + "a\\u005f\\u0300b", + "A\\u005f\\u0300b", + "a\\u0300b", + "A\\u0300b", + "a b", + "A b", + "a \\u0301b", + "A \\u0301b", + "a\\u0301b", + "A\\u0301b", + "a\\u005fb", + "A\\u005fb", + "a\\u005f\\u0301b", + "A\\u005f\\u0301b", + "a\\u0301b", + "A\\u0301b" + }, 22, + { UCOL_ALTERNATE_HANDLING, UCOL_STRENGTH }, { UCOL_SHIFTED, UCOL_QUATERNARY } + //{ UCOL_ALTERNATE_HANDLING, UCOL_STRENGTH }, { UCOL_NON_IGNORABLE, UCOL_TERTIARY } + } + }; + + int32_t i = 0; + + for(i = 0; i