add a very simple tst for unicode comparisons

This commit is contained in:
Enno Rehling 2016-08-07 10:28:09 +02:00
parent 4f5bd43dcf
commit 5dcbb8a3f4
1 changed files with 8 additions and 0 deletions

View File

@ -16,9 +16,17 @@ static void test_unicode_tolower(CuTest * tc)
CuAssertStrEquals(tc, "helloX", buffer); CuAssertStrEquals(tc, "helloX", buffer);
} }
static void test_unicode_compare(CuTest *tc)
{
CuAssertIntEquals(tc, 0, unicode_utf8_strcasecmp("ABCDEFG", "abcdefg"));
CuAssertIntEquals(tc, 0, unicode_utf8_strcasecmp("abcdefg123", "ABCDEFG123"));
CuAssertIntEquals(tc, 1, unicode_utf8_strcasecmp("bacdefg123", "ABCDEFG123"));
}
CuSuite *get_unicode_suite(void) CuSuite *get_unicode_suite(void)
{ {
CuSuite *suite = CuSuiteNew(); CuSuite *suite = CuSuiteNew();
SUITE_ADD_TEST(suite, test_unicode_tolower); SUITE_ADD_TEST(suite, test_unicode_tolower);
SUITE_ADD_TEST(suite, test_unicode_compare);
return suite; return suite;
} }