ICU-6991 Add test case for uspoof and reorder cintltst.

X-SVN-Rev: 26648
This commit is contained in:
Michael Ow 2009-09-18 06:38:49 +00:00
parent b02877f0e0
commit 6a639a823b
2 changed files with 6 additions and 2 deletions

View file

@ -44,7 +44,6 @@ void addAllTests(TestNode** root)
{
addCnvSelTest(root);
addUDataTest(root);
addPUtilTest(root);
addHeapMutexTest(root);
addUTF16Test(root);
addUTF8Test(root);
@ -79,6 +78,6 @@ void addAllTests(TestNode** root)
#if !UCONFIG_NO_REGULAR_EXPRESSIONS && !UCONFIG_NO_NORMALIZATION
addUSpoofTest(root);
#endif
addPUtilTest(root);
}

View file

@ -98,6 +98,8 @@ const UChar lll_Cyrl[] = {(UChar)0x0406, (UChar)0x04C0, (UChar)0x31, 0};
/* The skeleton transform for all of thes 'lll' lookalikes is all ascii digit 1. */
const UChar lll_Skel[] = {(UChar)0x31, (UChar)0x31, (UChar)0x31, 0};
/* Provide better code coverage */
const char goodLatinUTF8[] = {0x75, 0x77, 0};
/*
* Spoof Detction C API Tests
*/
@ -490,6 +492,9 @@ static void TestUSpoofCAPI(void) {
TEST_ASSERT_EQ(0, u_strcmp(lll_Skel, dest));
TEST_ASSERT_EQ(u_strlen(lll_Skel), skelLength);
skelLength = uspoof_getSkeletonUTF8(sc, USPOOF_ANY_CASE, goodLatinUTF8, -1, dest, sizeof(dest)/sizeof(UChar), &status);
TEST_ASSERT_SUCCESS(status);
skelLength = uspoof_getSkeleton(sc, USPOOF_ANY_CASE, lll_Latin_a, -1, NULL, 0, &status);
TEST_ASSERT_EQ(U_BUFFER_OVERFLOW_ERROR, status);
TEST_ASSERT_EQ(3, skelLength);