diff --git a/icu4c/source/test/cintltst/callcoll.c b/icu4c/source/test/cintltst/callcoll.c index 4635fee71b8..cd84838d0de 100644 --- a/icu4c/source/test/cintltst/callcoll.c +++ b/icu4c/source/test/cintltst/callcoll.c @@ -68,6 +68,8 @@ static void TestVariableTop(void); /* Test surrogates */ static void TestSurrogates(void); +static void TestInvalidRules(void); + #endif const UChar testSourceCases[][16] = { @@ -228,7 +230,9 @@ void addAllCollTest(TestNode** root) addTest(root, &TestExtra, "tscoll/callcoll/TestExtra"); addTest(root, &TestJB581, "tscoll/callcoll/TestJB581"); addTest(root, &TestVariableTop, "tscoll/callcoll/TestVariableTop"); - addTest(root, &TestSurrogates, "tscoll/callcoll/TestSurrogates"); + addTest(root, &TestSurrogates, "tscoll/callcoll/TestSurrogates"); + addTest(root, &TestInvalidRules, "tscoll/callcoll/TestInvalidRules"); + } static void doTestVariant(UCollator* myCollation, const UChar source[], const UChar target[], UCollationResult result) @@ -644,4 +648,50 @@ static void TestSurrogates(void) myCollation = NULL; } +/* + *### TODO: Add more invalid rules to test all different scenarios. + * + */ +static void +TestInvalidRules(){ +#define MAX_ERROR_STATES 2 + + static const char* rulesArr[MAX_ERROR_STATES] = { + "& C < ch, cH, Ch[this should fail]