1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 /********************************************************************
5 * Copyright (c) 2009-2016, International Business Machines Corporation and
6 * others. All Rights Reserved.
7 ********************************************************************/
8 /********************************************************************************
12 *********************************************************************************/
13 /*C API TEST for the uspoof Unicode Indentifier Spoofing and Security API */
15 * This is an API test for ICU spoof detection in plain C. It doesn't test very many cases, and doesn't
16 * try to test the full functionality. It just calls each function and verifies that it
17 * works on a basic level.
19 * More complete testing of spoof detection functionality is done with the C++ tests.
22 #include "unicode/utypes.h"
23 #if !UCONFIG_NO_REGULAR_EXPRESSIONS && !UCONFIG_NO_NORMALIZATION
28 #include "unicode/uspoof.h"
29 #include "unicode/ustring.h"
30 #include "unicode/uset.h"
34 #define TEST_ASSERT_SUCCESS(status) {if (U_FAILURE(status)) { \
35 log_err_status(status, "Failure at file %s, line %d, error = %s\n", __FILE__, __LINE__, u_errorName(status));}}
37 #define TEST_ASSERT(expr) {if ((expr)==FALSE) { \
38 log_err("Test Failure at file %s, line %d: \"%s\" is false.\n", __FILE__, __LINE__, #expr);};}
40 #define TEST_ASSERT_EQ(a, b) { if ((a) != (b)) { \
41 log_err("Test Failure at file %s, line %d: \"%s\" (%d) != \"%s\" (%d) \n", \
42 __FILE__, __LINE__, #a, (a), #b, (b)); }}
44 #define TEST_ASSERT_NE(a, b) { if ((a) == (b)) { \
45 log_err("Test Failure at file %s, line %d: \"%s\" (%d) == \"%s\" (%d) \n", \
46 __FILE__, __LINE__, #a, (a), #b, (b)); }}
50 * TEST_SETUP and TEST_TEARDOWN
51 * macros to handle the boilerplate around setting up test case.
52 * Put arbitrary test code between SETUP and TEARDOWN.
53 * "sc" is the ready-to-go SpoofChecker for use in the tests.
55 #define TEST_SETUP { \
56 UErrorCode status = U_ZERO_ERROR; \
58 sc = uspoof_open(&status); \
59 TEST_ASSERT_SUCCESS(status); \
60 if (U_SUCCESS(status)){
62 #define TEST_TEARDOWN \
64 TEST_ASSERT_SUCCESS(status); \
68 static void TestOpenFromSource(void);
69 static void TestUSpoofCAPI(void);
71 void addUSpoofTest(TestNode
** root
);
73 void addUSpoofTest(TestNode
** root
)
75 #if !UCONFIG_NO_FILE_IO
76 addTest(root
, &TestOpenFromSource
, "uspoof/TestOpenFromSource");
78 addTest(root
, &TestUSpoofCAPI
, "uspoof/TestUSpoofCAPI");
82 * Identifiers for verifying that spoof checking is minimally alive and working.
84 const UChar goodLatin
[] = {(UChar
)0x75, (UChar
)0x7a, 0}; /* "uz", all ASCII */
85 /* (not confusable) */
86 const UChar scMixed
[] = {(UChar
)0x73, (UChar
)0x0441, 0}; /* "sc", with Cyrillic 'c' */
87 /* (mixed script, confusable */
89 const UChar scLatin
[] = {(UChar
)0x73, (UChar
)0x63, 0}; /* "sc", plain ascii. */
90 const UChar goodCyrl
[] = {(UChar
)0x438, (UChar
)0x43B, 0}; /* Plain lower case Cyrillic letters,
91 no latin confusables */
93 const UChar goodGreek
[] = {(UChar
)0x3c0, (UChar
)0x3c6, 0}; /* Plain lower case Greek letters */
95 const UChar lll_Latin_a
[] = {(UChar
)0x6c, (UChar
)0x49, (UChar
)0x31, 0}; /* lI1, all ASCII */
97 /* Full-width I, Small Roman Numeral fifty, Latin Cap Letter IOTA*/
98 const UChar lll_Latin_b
[] = {(UChar
)0xff29, (UChar
)0x217c, (UChar
)0x196, 0};
100 const UChar lll_Cyrl
[] = {(UChar
)0x0406, (UChar
)0x04C0, (UChar
)0x31, 0};
102 /* The skeleton transform for all of thes 'lll' lookalikes is all lower case l. */
103 const UChar lll_Skel
[] = {(UChar
)0x6c, (UChar
)0x6c, (UChar
)0x6c, 0};
105 const UChar han_Hiragana
[] = {(UChar
)0x3086, (UChar
)0x308A, (UChar
)0x0020, (UChar
)0x77F3, (UChar
)0x7530, 0};
107 /* Provide better code coverage */
108 const char goodLatinUTF8
[] = {0x75, 0x77, 0};
110 // Test open from source rules.
111 // Run this in isolation to verify initialization.
112 static void TestOpenFromSource() {
113 // No TEST_SETUP because that calls uspoof_open().
114 UErrorCode status
= U_ZERO_ERROR
;
115 const char *dataSrcDir
;
118 int confusablesLength
= 0;
119 char *confusablesWholeScript
;
120 int confusablesWholeScriptLength
= 0;
124 int32_t checkResults
;
127 dataSrcDir
= ctest_dataSrcDir();
128 fileName
= malloc(strlen(dataSrcDir
) + 100);
129 strcpy(fileName
, dataSrcDir
);
130 strcat(fileName
, U_FILE_SEP_STRING
"unidata" U_FILE_SEP_STRING
"confusables.txt");
131 f
= fopen(fileName
, "rb");
132 TEST_ASSERT_NE(f
, NULL
);
133 confusables
= malloc(3000000);
135 confusablesLength
= fread(confusables
, 1, 3000000, f
);
139 strcpy(fileName
, dataSrcDir
);
140 strcat(fileName
, U_FILE_SEP_STRING
"unidata" U_FILE_SEP_STRING
"confusablesWholeScript.txt");
141 f
= fopen(fileName
, "rb");
142 TEST_ASSERT_NE(f
, NULL
);
143 confusablesWholeScript
= malloc(1000000);
145 confusablesWholeScriptLength
= fread(confusablesWholeScript
, 1, 1000000, f
);
149 rsc
= uspoof_openFromSource(confusables
, confusablesLength
,
150 confusablesWholeScript
, confusablesWholeScriptLength
,
151 &errType
, &pe
, &status
);
152 TEST_ASSERT_SUCCESS(status
);
154 // Ticket #11860: uspoof_openFromSource() did not initialize for use.
155 // Verify that the spoof checker does not crash.
156 checkResults
= uspoof_check(rsc
, goodLatin
, -1, NULL
, &status
);
157 TEST_ASSERT_SUCCESS(status
);
158 TEST_ASSERT_EQ(0, checkResults
);
160 free(confusablesWholeScript
);
164 /* printf("ParseError Line is %d\n", pe.line); */
168 * Spoof Detection C API Tests
170 static void TestUSpoofCAPI(void) {
173 * basic uspoof_open().
177 UErrorCode status
= U_ZERO_ERROR
;
178 sc
= uspoof_open(&status
);
179 TEST_ASSERT_SUCCESS(status
);
180 if (U_FAILURE(status
)) {
181 /* If things are so broken that we can't even open a default spoof checker, */
182 /* don't even try the rest of the tests. They would all fail. */
189 * openFromSerialized and serialize
192 int32_t serializedSize
= 0;
193 int32_t actualLength
= 0;
196 int32_t checkResults
;
199 serializedSize
= uspoof_serialize(sc
, NULL
, 0, &status
);
200 TEST_ASSERT_EQ(status
, U_BUFFER_OVERFLOW_ERROR
);
201 TEST_ASSERT(serializedSize
> 0);
203 /* Serialize the default spoof checker */
204 status
= U_ZERO_ERROR
;
205 buf
= (char *)malloc(serializedSize
+ 10);
206 TEST_ASSERT(buf
!= NULL
);
207 buf
[serializedSize
] = 42;
208 uspoof_serialize(sc
, buf
, serializedSize
, &status
);
209 TEST_ASSERT_SUCCESS(status
);
210 TEST_ASSERT_EQ(42, buf
[serializedSize
]);
212 /* Create a new spoof checker from the freshly serialized data */
213 sc2
= uspoof_openFromSerialized(buf
, serializedSize
+10, &actualLength
, &status
);
214 TEST_ASSERT_SUCCESS(status
);
215 TEST_ASSERT_NE(NULL
, sc2
);
216 TEST_ASSERT_EQ(serializedSize
, actualLength
);
218 /* Verify that the new spoof checker at least wiggles */
219 checkResults
= uspoof_check(sc2
, goodLatin
, -1, NULL
, &status
);
220 TEST_ASSERT_SUCCESS(status
);
221 TEST_ASSERT_EQ(0, checkResults
);
223 checkResults
= uspoof_check(sc2
, scMixed
, -1, NULL
, &status
);
224 TEST_ASSERT_SUCCESS(status
);
225 TEST_ASSERT_EQ(USPOOF_SINGLE_SCRIPT
, checkResults
);
234 * Set & Get Check Flags
238 uspoof_setChecks(sc
, USPOOF_ALL_CHECKS
, &status
);
239 TEST_ASSERT_SUCCESS(status
);
240 t
= uspoof_getChecks(sc
, &status
);
241 TEST_ASSERT_EQ(t
, USPOOF_ALL_CHECKS
);
243 uspoof_setChecks(sc
, 0, &status
);
244 TEST_ASSERT_SUCCESS(status
);
245 t
= uspoof_getChecks(sc
, &status
);
246 TEST_ASSERT_EQ(0, t
);
249 USPOOF_WHOLE_SCRIPT_CONFUSABLE
| USPOOF_MIXED_SCRIPT_CONFUSABLE
| USPOOF_ANY_CASE
,
251 TEST_ASSERT_SUCCESS(status
);
252 t
= uspoof_getChecks(sc
, &status
);
253 TEST_ASSERT_SUCCESS(status
);
254 TEST_ASSERT_EQ(USPOOF_WHOLE_SCRIPT_CONFUSABLE
| USPOOF_MIXED_SCRIPT_CONFUSABLE
| USPOOF_ANY_CASE
, t
);
258 * get & setAllowedChars
264 uset
= uspoof_getAllowedChars(sc
, &status
);
265 TEST_ASSERT_SUCCESS(status
);
266 TEST_ASSERT(uset_isFrozen(uset
));
267 us
= uset_open((UChar32
)0x41, (UChar32
)0x5A); /* [A-Z] */
268 uspoof_setAllowedChars(sc
, us
, &status
);
269 TEST_ASSERT_SUCCESS(status
);
270 TEST_ASSERT_NE(us
, uspoof_getAllowedChars(sc
, &status
));
271 TEST_ASSERT(uset_equals(us
, uspoof_getAllowedChars(sc
, &status
)));
272 TEST_ASSERT_SUCCESS(status
);
281 USpoofChecker
*clone1
= NULL
;
282 USpoofChecker
*clone2
= NULL
;
283 int32_t checkResults
= 0;
285 clone1
= uspoof_clone(sc
, &status
);
286 TEST_ASSERT_SUCCESS(status
);
287 TEST_ASSERT_NE(clone1
, sc
);
289 clone2
= uspoof_clone(clone1
, &status
);
290 TEST_ASSERT_SUCCESS(status
);
291 TEST_ASSERT_NE(clone2
, clone1
);
293 uspoof_close(clone1
);
295 /* Verify that the cloned spoof checker is alive */
296 checkResults
= uspoof_check(clone2
, goodLatin
, -1, NULL
, &status
);
297 TEST_ASSERT_SUCCESS(status
);
298 TEST_ASSERT_EQ(0, checkResults
);
300 checkResults
= uspoof_check(clone2
, scMixed
, -1, NULL
, &status
);
301 TEST_ASSERT_SUCCESS(status
);
302 TEST_ASSERT_EQ(USPOOF_SINGLE_SCRIPT
, checkResults
);
303 uspoof_close(clone2
);
307 * basic uspoof_check()
311 result
= uspoof_check(sc
, goodLatin
, -1, NULL
, &status
);
312 TEST_ASSERT_SUCCESS(status
);
313 TEST_ASSERT_EQ(0, result
);
315 result
= uspoof_check(sc
, han_Hiragana
, -1, NULL
, &status
);
316 TEST_ASSERT_SUCCESS(status
);
317 TEST_ASSERT_EQ(0, result
);
319 result
= uspoof_check(sc
, scMixed
, -1, NULL
, &status
);
320 TEST_ASSERT_SUCCESS(status
);
321 TEST_ASSERT_EQ(USPOOF_SINGLE_SCRIPT
, result
);
331 int32_t checkResults
;
333 checks
= uspoof_getChecks(sc
, &status
);
334 TEST_ASSERT_SUCCESS(status
);
335 TEST_ASSERT_EQ(USPOOF_ALL_CHECKS
, checks
);
337 checks
&= ~(USPOOF_SINGLE_SCRIPT
| USPOOF_MIXED_SCRIPT_CONFUSABLE
);
338 uspoof_setChecks(sc
, checks
, &status
);
339 TEST_ASSERT_SUCCESS(status
);
340 checks2
= uspoof_getChecks(sc
, &status
);
341 TEST_ASSERT_EQ(checks
, checks2
);
343 /* The checks that were disabled just above are the same ones that the "scMixed" test fails.
344 So with those tests gone checking that Identifier should now succeed */
345 checkResults
= uspoof_check(sc
, scMixed
, -1, NULL
, &status
);
346 TEST_ASSERT_SUCCESS(status
);
347 TEST_ASSERT_EQ(0, checkResults
);
355 const char *allowedLocales
;
356 int32_t checkResults
;
358 /* Default allowed locales list should be empty */
359 allowedLocales
= uspoof_getAllowedLocales(sc
, &status
);
360 TEST_ASSERT_SUCCESS(status
);
361 TEST_ASSERT(strcmp("", allowedLocales
) == 0)
363 /* Allow en and ru, which should enable Latin and Cyrillic only to pass */
364 uspoof_setAllowedLocales(sc
, "en, ru_RU", &status
);
365 TEST_ASSERT_SUCCESS(status
);
366 allowedLocales
= uspoof_getAllowedLocales(sc
, &status
);
367 TEST_ASSERT_SUCCESS(status
);
368 TEST_ASSERT(strstr(allowedLocales
, "en") != NULL
);
369 TEST_ASSERT(strstr(allowedLocales
, "ru") != NULL
);
371 /* Limit checks to USPOOF_CHAR_LIMIT. Some of the test data has whole script confusables also,
372 * which we don't want to see in this test. */
373 uspoof_setChecks(sc
, USPOOF_CHAR_LIMIT
, &status
);
374 TEST_ASSERT_SUCCESS(status
);
376 checkResults
= uspoof_check(sc
, goodLatin
, -1, NULL
, &status
);
377 TEST_ASSERT_SUCCESS(status
);
378 TEST_ASSERT_EQ(0, checkResults
);
380 checkResults
= uspoof_check(sc
, goodGreek
, -1, NULL
, &status
);
381 TEST_ASSERT_SUCCESS(status
);
382 TEST_ASSERT_EQ(USPOOF_CHAR_LIMIT
, checkResults
);
384 checkResults
= uspoof_check(sc
, goodCyrl
, -1, NULL
, &status
);
385 TEST_ASSERT_SUCCESS(status
);
386 TEST_ASSERT_EQ(0, checkResults
);
388 /* Reset with an empty locale list, which should allow all characters to pass */
389 uspoof_setAllowedLocales(sc
, " ", &status
);
390 TEST_ASSERT_SUCCESS(status
);
392 checkResults
= uspoof_check(sc
, goodGreek
, -1, NULL
, &status
);
393 TEST_ASSERT_SUCCESS(status
);
394 TEST_ASSERT_EQ(0, checkResults
);
398 * AllowedChars set/get the USet of allowed characters.
403 int32_t checkResults
;
405 /* By default, we should see no restriction; the USet should allow all characters. */
406 set
= uspoof_getAllowedChars(sc
, &status
);
407 TEST_ASSERT_SUCCESS(status
);
408 tmpSet
= uset_open(0, 0x10ffff);
409 TEST_ASSERT(uset_equals(tmpSet
, set
));
411 /* Setting the allowed chars should enable the check. */
412 uspoof_setChecks(sc
, USPOOF_ALL_CHECKS
& ~USPOOF_CHAR_LIMIT
, &status
);
413 TEST_ASSERT_SUCCESS(status
);
415 /* Remove a character that is in our good Latin test identifier from the allowed chars set. */
416 uset_remove(tmpSet
, goodLatin
[1]);
417 uspoof_setAllowedChars(sc
, tmpSet
, &status
);
418 TEST_ASSERT_SUCCESS(status
);
421 /* Latin Identifier should now fail; other non-latin test cases should still be OK
422 * Note: fail of CHAR_LIMIT also causes the restriction level to be USPOOF_UNRESTRICTIVE
423 * which will give us a USPOOF_RESTRICTION_LEVEL failure.
425 checkResults
= uspoof_check(sc
, goodLatin
, -1, NULL
, &status
);
426 TEST_ASSERT_SUCCESS(status
);
427 TEST_ASSERT_EQ(USPOOF_CHAR_LIMIT
| USPOOF_RESTRICTION_LEVEL
, checkResults
);
429 checkResults
= uspoof_check(sc
, goodGreek
, -1, NULL
, &status
);
430 TEST_ASSERT_SUCCESS(status
);
431 TEST_ASSERT_EQ(0, checkResults
);
439 int32_t checkResults
, checkResults2
;
442 u_strToUTF8(utf8buf
, sizeof(utf8buf
), NULL
, goodLatin
, -1, &status
);
443 TEST_ASSERT_SUCCESS(status
);
445 checkResults
= uspoof_checkUTF8(sc
, utf8buf
, -1, &position
, &status
);
446 TEST_ASSERT_SUCCESS(status
);
447 TEST_ASSERT_EQ(0, checkResults
);
448 TEST_ASSERT_EQ(0, position
);
450 u_strToUTF8(utf8buf
, sizeof(utf8buf
), NULL
, goodCyrl
, -1, &status
);
451 TEST_ASSERT_SUCCESS(status
);
452 checkResults
= uspoof_checkUTF8(sc
, utf8buf
, -1, &position
, &status
);
453 TEST_ASSERT_SUCCESS(status
);
454 TEST_ASSERT_EQ(0, checkResults
);
456 u_strToUTF8(utf8buf
, sizeof(utf8buf
), NULL
, scMixed
, -1, &status
);
457 TEST_ASSERT_SUCCESS(status
);
459 checkResults
= uspoof_checkUTF8(sc
, utf8buf
, -1, &position
, &status
);
460 checkResults2
= uspoof_check(sc
, scMixed
, -1, NULL
, &status
);
461 TEST_ASSERT_SUCCESS(status
);
462 TEST_ASSERT_EQ(USPOOF_SINGLE_SCRIPT
, checkResults
);
463 TEST_ASSERT_EQ(0, position
);
464 TEST_ASSERT_EQ(checkResults
, checkResults2
);
469 * uspoof_check2 variants
472 int32_t result1
, result2
;
474 uspoof_setChecks(sc
, USPOOF_ALL_CHECKS
| USPOOF_AUX_INFO
, &status
);
475 USpoofCheckResult
* checkResult
= uspoof_openCheckResult(&status
);
476 TEST_ASSERT_SUCCESS(status
);
478 const UChar
* tests
[] = { goodLatin
, scMixed
, scLatin
,
479 goodCyrl
, goodGreek
, lll_Latin_a
, lll_Latin_b
, han_Hiragana
};
481 for (int32_t i
=0; i
<UPRV_LENGTHOF(tests
); i
++) {
482 const UChar
* str
= tests
[i
];
485 result1
= uspoof_check(sc
, str
, -1, NULL
, &status
);
486 result2
= uspoof_check2(sc
, str
, -1, NULL
, &status
);
487 TEST_ASSERT_SUCCESS(status
);
488 TEST_ASSERT_EQ(result1
, result2
);
490 // With check result parameter
491 result1
= uspoof_check(sc
, str
, -1, NULL
, &status
);
492 result2
= uspoof_check2(sc
, str
, -1, checkResult
, &status
);
493 TEST_ASSERT_SUCCESS(status
);
494 TEST_ASSERT_EQ(result1
, result2
);
496 // Checks from checkResult should be same as those from bitmask
497 TEST_ASSERT_EQ(result1
& USPOOF_ALL_CHECKS
, uspoof_getCheckResultChecks(checkResult
, &status
));
499 // Restriction level from checkResult should be same as that from bitmask
500 URestrictionLevel restrictionLevel
= uspoof_getCheckResultRestrictionLevel(checkResult
, &status
);
501 TEST_ASSERT_EQ(result1
& restrictionLevel
, restrictionLevel
);
504 u_strToUTF8(utf8buf
, sizeof(utf8buf
), NULL
, goodLatin
, -1, &status
);
505 TEST_ASSERT_SUCCESS(status
);
506 result1
= uspoof_checkUTF8(sc
, utf8buf
, -1, NULL
, &status
);
507 result2
= uspoof_check2UTF8(sc
, utf8buf
, -1, NULL
, &status
);
508 TEST_ASSERT_SUCCESS(status
);
509 TEST_ASSERT_EQ(result1
, result2
);
512 uspoof_closeCheckResult(checkResult
);
516 * uspoof_areConfusable()
519 int32_t checkResults
;
521 checkResults
= uspoof_areConfusable(sc
, scLatin
, -1, scMixed
, -1, &status
);
522 TEST_ASSERT_SUCCESS(status
);
523 TEST_ASSERT_EQ(USPOOF_MIXED_SCRIPT_CONFUSABLE
, checkResults
);
525 checkResults
= uspoof_areConfusable(sc
, goodGreek
, -1, scLatin
, -1, &status
);
526 TEST_ASSERT_SUCCESS(status
);
527 TEST_ASSERT_EQ(0, checkResults
);
529 checkResults
= uspoof_areConfusable(sc
, lll_Latin_a
, -1, lll_Latin_b
, -1, &status
);
530 TEST_ASSERT_SUCCESS(status
);
531 TEST_ASSERT_EQ(USPOOF_SINGLE_SCRIPT_CONFUSABLE
, checkResults
);
539 int32_t checkResults
;
544 u_strToUTF8(s1
, sizeof(s1
), NULL
, scLatin
, -1, &status
);
545 u_strToUTF8(s2
, sizeof(s2
), NULL
, scMixed
, -1, &status
);
546 TEST_ASSERT_SUCCESS(status
);
547 checkResults
= uspoof_areConfusableUTF8(sc
, s1
, -1, s2
, -1, &status
);
548 TEST_ASSERT_SUCCESS(status
);
549 TEST_ASSERT_EQ(USPOOF_MIXED_SCRIPT_CONFUSABLE
, checkResults
);
551 u_strToUTF8(s1
, sizeof(s1
), NULL
, goodGreek
, -1, &status
);
552 u_strToUTF8(s2
, sizeof(s2
), NULL
, scLatin
, -1, &status
);
553 TEST_ASSERT_SUCCESS(status
);
554 checkResults
= uspoof_areConfusableUTF8(sc
, s1
, -1, s2
, -1, &status
);
555 TEST_ASSERT_SUCCESS(status
);
556 TEST_ASSERT_EQ(0, checkResults
);
558 u_strToUTF8(s1
, sizeof(s1
), NULL
, lll_Latin_a
, -1, &status
);
559 u_strToUTF8(s2
, sizeof(s2
), NULL
, lll_Latin_b
, -1, &status
);
560 TEST_ASSERT_SUCCESS(status
);
561 checkResults
= uspoof_areConfusableUTF8(sc
, s1
, -1, s2
, -1, &status
);
562 TEST_ASSERT_SUCCESS(status
);
563 TEST_ASSERT_EQ(USPOOF_SINGLE_SCRIPT_CONFUSABLE
, checkResults
);
576 skelLength
= uspoof_getSkeleton(sc
, USPOOF_ANY_CASE
, lll_Latin_a
, -1, dest
, UPRV_LENGTHOF(dest
), &status
);
577 TEST_ASSERT_SUCCESS(status
);
578 TEST_ASSERT_EQ(0, u_strcmp(lll_Skel
, dest
));
579 TEST_ASSERT_EQ(u_strlen(lll_Skel
), skelLength
);
581 skelLength
= uspoof_getSkeletonUTF8(sc
, USPOOF_ANY_CASE
, goodLatinUTF8
, -1, (char*)dest
,
582 UPRV_LENGTHOF(dest
), &status
);
583 TEST_ASSERT_SUCCESS(status
);
585 skelLength
= uspoof_getSkeleton(sc
, USPOOF_ANY_CASE
, lll_Latin_a
, -1, NULL
, 0, &status
);
586 TEST_ASSERT_EQ(U_BUFFER_OVERFLOW_ERROR
, status
);
587 TEST_ASSERT_EQ(3, skelLength
);
588 status
= U_ZERO_ERROR
;
593 * get Inclusion and Recommended sets
596 const USet
*inclusions
= NULL
;
597 const USet
*recommended
= NULL
;
599 inclusions
= uspoof_getInclusionSet(&status
);
600 TEST_ASSERT_SUCCESS(status
);
601 TEST_ASSERT_EQ(TRUE
, uset_isFrozen(inclusions
));
603 status
= U_ZERO_ERROR
;
604 recommended
= uspoof_getRecommendedSet(&status
);
605 TEST_ASSERT_SUCCESS(status
);
606 TEST_ASSERT_EQ(TRUE
, uset_isFrozen(recommended
));
611 #endif /* UCONFIG_NO_REGULAR_EXPRESSIONS */