]> git.saurik.com Git - apple/icu.git/blob - icuSources/test/cintltst/spooftest.c
ICU-57132.0.1.tar.gz
[apple/icu.git] / icuSources / test / cintltst / spooftest.c
1 /********************************************************************
2 * COPYRIGHT:
3 * Copyright (c) 2009-2016, International Business Machines Corporation and
4 * others. All Rights Reserved.
5 ********************************************************************/
6 /********************************************************************************
7 *
8 * File spooftest.c
9 *
10 *********************************************************************************/
11 /*C API TEST for the uspoof Unicode Indentifier Spoofing and Security API */
12 /**
13 * This is an API test for ICU spoof detection in plain C. It doesn't test very many cases, and doesn't
14 * try to test the full functionality. It just calls each function and verifies that it
15 * works on a basic level.
16 *
17 * More complete testing of spoof detection functionality is done with the C++ tests.
18 **/
19
20 #include "unicode/utypes.h"
21 #if !UCONFIG_NO_REGULAR_EXPRESSIONS && !UCONFIG_NO_NORMALIZATION
22
23 #include <stdlib.h>
24 #include <stdio.h>
25 #include <string.h>
26 #include "unicode/uspoof.h"
27 #include "unicode/ustring.h"
28 #include "unicode/uset.h"
29 #include "cintltst.h"
30 #include "cmemory.h"
31
32 #define TEST_ASSERT_SUCCESS(status) {if (U_FAILURE(status)) { \
33 log_err_status(status, "Failure at file %s, line %d, error = %s\n", __FILE__, __LINE__, u_errorName(status));}}
34
35 #define TEST_ASSERT(expr) {if ((expr)==FALSE) { \
36 log_err("Test Failure at file %s, line %d: \"%s\" is false.\n", __FILE__, __LINE__, #expr);};}
37
38 #define TEST_ASSERT_EQ(a, b) { if ((a) != (b)) { \
39 log_err("Test Failure at file %s, line %d: \"%s\" (%d) != \"%s\" (%d) \n", \
40 __FILE__, __LINE__, #a, (a), #b, (b)); }}
41
42 #define TEST_ASSERT_NE(a, b) { if ((a) == (b)) { \
43 log_err("Test Failure at file %s, line %d: \"%s\" (%d) == \"%s\" (%d) \n", \
44 __FILE__, __LINE__, #a, (a), #b, (b)); }}
45
46
47 /*
48 * TEST_SETUP and TEST_TEARDOWN
49 * macros to handle the boilerplate around setting up test case.
50 * Put arbitrary test code between SETUP and TEARDOWN.
51 * "sc" is the ready-to-go SpoofChecker for use in the tests.
52 */
53 #define TEST_SETUP { \
54 UErrorCode status = U_ZERO_ERROR; \
55 USpoofChecker *sc; \
56 sc = uspoof_open(&status); \
57 TEST_ASSERT_SUCCESS(status); \
58 if (U_SUCCESS(status)){
59
60 #define TEST_TEARDOWN \
61 } \
62 TEST_ASSERT_SUCCESS(status); \
63 uspoof_close(sc); \
64 }
65
66 static void TestOpenFromSource(void);
67 static void TestUSpoofCAPI(void);
68
69 void addUSpoofTest(TestNode** root);
70
71 void addUSpoofTest(TestNode** root)
72 {
73 #if !UCONFIG_NO_FILE_IO
74 addTest(root, &TestOpenFromSource, "uspoof/TestOpenFromSource");
75 #endif
76 addTest(root, &TestUSpoofCAPI, "uspoof/TestUSpoofCAPI");
77 }
78
79 /*
80 * Identifiers for verifying that spoof checking is minimally alive and working.
81 */
82 const UChar goodLatin[] = {(UChar)0x75, (UChar)0x7a, 0}; /* "uz", all ASCII */
83 /* (not confusable) */
84 const UChar scMixed[] = {(UChar)0x73, (UChar)0x0441, 0}; /* "sc", with Cyrillic 'c' */
85 /* (mixed script, confusable */
86
87 const UChar scLatin[] = {(UChar)0x73, (UChar)0x63, 0}; /* "sc", plain ascii. */
88 const UChar goodCyrl[] = {(UChar)0x438, (UChar)0x43B, 0}; /* Plain lower case Cyrillic letters,
89 no latin confusables */
90
91 const UChar goodGreek[] = {(UChar)0x3c0, (UChar)0x3c6, 0}; /* Plain lower case Greek letters */
92
93 const UChar lll_Latin_a[] = {(UChar)0x6c, (UChar)0x49, (UChar)0x31, 0}; /* lI1, all ASCII */
94
95 /* Full-width I, Small Roman Numeral fifty, Latin Cap Letter IOTA*/
96 const UChar lll_Latin_b[] = {(UChar)0xff29, (UChar)0x217c, (UChar)0x196, 0};
97
98 const UChar lll_Cyrl[] = {(UChar)0x0406, (UChar)0x04C0, (UChar)0x31, 0};
99
100 /* The skeleton transform for all of thes 'lll' lookalikes is all lower case l. */
101 const UChar lll_Skel[] = {(UChar)0x6c, (UChar)0x6c, (UChar)0x6c, 0};
102
103 const UChar han_Hiragana[] = {(UChar)0x3086, (UChar)0x308A, (UChar)0x0020, (UChar)0x77F3, (UChar)0x7530, 0};
104
105 /* Provide better code coverage */
106 const char goodLatinUTF8[] = {0x75, 0x77, 0};
107
108 // Test open from source rules.
109 // Run this in isolation to verify initialization.
110 static void TestOpenFromSource() {
111 // No TEST_SETUP because that calls uspoof_open().
112 UErrorCode status = U_ZERO_ERROR;
113 const char *dataSrcDir;
114 char *fileName;
115 char *confusables;
116 int confusablesLength = 0;
117 char *confusablesWholeScript;
118 int confusablesWholeScriptLength = 0;
119 FILE *f;
120 UParseError pe;
121 int32_t errType;
122 int32_t checkResults;
123 USpoofChecker *rsc;
124
125 dataSrcDir = ctest_dataSrcDir();
126 fileName = malloc(strlen(dataSrcDir) + 100);
127 strcpy(fileName, dataSrcDir);
128 strcat(fileName, U_FILE_SEP_STRING "unidata" U_FILE_SEP_STRING "confusables.txt");
129 f = fopen(fileName, "rb");
130 TEST_ASSERT_NE(f, NULL);
131 confusables = malloc(3000000);
132 if (f != NULL) {
133 confusablesLength = fread(confusables, 1, 3000000, f);
134 fclose(f);
135 }
136
137 strcpy(fileName, dataSrcDir);
138 strcat(fileName, U_FILE_SEP_STRING "unidata" U_FILE_SEP_STRING "confusablesWholeScript.txt");
139 f = fopen(fileName, "rb");
140 TEST_ASSERT_NE(f, NULL);
141 confusablesWholeScript = malloc(1000000);
142 if (f != NULL) {
143 confusablesWholeScriptLength = fread(confusablesWholeScript, 1, 1000000, f);
144 fclose(f);
145 }
146
147 rsc = uspoof_openFromSource(confusables, confusablesLength,
148 confusablesWholeScript, confusablesWholeScriptLength,
149 &errType, &pe, &status);
150 TEST_ASSERT_SUCCESS(status);
151
152 // Ticket #11860: uspoof_openFromSource() did not initialize for use.
153 // Verify that the spoof checker does not crash.
154 checkResults = uspoof_check(rsc, goodLatin, -1, NULL, &status);
155 TEST_ASSERT_SUCCESS(status);
156 TEST_ASSERT_EQ(0, checkResults);
157
158 free(confusablesWholeScript);
159 free(confusables);
160 free(fileName);
161 uspoof_close(rsc);
162 /* printf("ParseError Line is %d\n", pe.line); */
163 }
164
165 /*
166 * Spoof Detection C API Tests
167 */
168 static void TestUSpoofCAPI(void) {
169
170 /*
171 * basic uspoof_open().
172 */
173 {
174 USpoofChecker *sc;
175 UErrorCode status = U_ZERO_ERROR;
176 sc = uspoof_open(&status);
177 TEST_ASSERT_SUCCESS(status);
178 if (U_FAILURE(status)) {
179 /* If things are so broken that we can't even open a default spoof checker, */
180 /* don't even try the rest of the tests. They would all fail. */
181 return;
182 }
183 uspoof_close(sc);
184 }
185
186 /*
187 * openFromSerialized and serialize
188 */
189 TEST_SETUP
190 int32_t serializedSize = 0;
191 int32_t actualLength = 0;
192 char *buf;
193 USpoofChecker *sc2;
194 int32_t checkResults;
195
196
197 serializedSize = uspoof_serialize(sc, NULL, 0, &status);
198 TEST_ASSERT_EQ(status, U_BUFFER_OVERFLOW_ERROR);
199 TEST_ASSERT(serializedSize > 0);
200
201 /* Serialize the default spoof checker */
202 status = U_ZERO_ERROR;
203 buf = (char *)malloc(serializedSize + 10);
204 TEST_ASSERT(buf != NULL);
205 buf[serializedSize] = 42;
206 uspoof_serialize(sc, buf, serializedSize, &status);
207 TEST_ASSERT_SUCCESS(status);
208 TEST_ASSERT_EQ(42, buf[serializedSize]);
209
210 /* Create a new spoof checker from the freshly serialized data */
211 sc2 = uspoof_openFromSerialized(buf, serializedSize+10, &actualLength, &status);
212 TEST_ASSERT_SUCCESS(status);
213 TEST_ASSERT_NE(NULL, sc2);
214 TEST_ASSERT_EQ(serializedSize, actualLength);
215
216 /* Verify that the new spoof checker at least wiggles */
217 checkResults = uspoof_check(sc2, goodLatin, -1, NULL, &status);
218 TEST_ASSERT_SUCCESS(status);
219 TEST_ASSERT_EQ(0, checkResults);
220
221 checkResults = uspoof_check(sc2, scMixed, -1, NULL, &status);
222 TEST_ASSERT_SUCCESS(status);
223 TEST_ASSERT_EQ(USPOOF_SINGLE_SCRIPT | USPOOF_MIXED_SCRIPT_CONFUSABLE, checkResults);
224
225 uspoof_close(sc2);
226 free(buf);
227 TEST_TEARDOWN;
228
229
230
231 /*
232 * Set & Get Check Flags
233 */
234 TEST_SETUP
235 int32_t t;
236 uspoof_setChecks(sc, USPOOF_ALL_CHECKS, &status);
237 TEST_ASSERT_SUCCESS(status);
238 t = uspoof_getChecks(sc, &status);
239 TEST_ASSERT_EQ(t, USPOOF_ALL_CHECKS);
240
241 uspoof_setChecks(sc, 0, &status);
242 TEST_ASSERT_SUCCESS(status);
243 t = uspoof_getChecks(sc, &status);
244 TEST_ASSERT_EQ(0, t);
245
246 uspoof_setChecks(sc,
247 USPOOF_WHOLE_SCRIPT_CONFUSABLE | USPOOF_MIXED_SCRIPT_CONFUSABLE | USPOOF_ANY_CASE,
248 &status);
249 TEST_ASSERT_SUCCESS(status);
250 t = uspoof_getChecks(sc, &status);
251 TEST_ASSERT_SUCCESS(status);
252 TEST_ASSERT_EQ(USPOOF_WHOLE_SCRIPT_CONFUSABLE | USPOOF_MIXED_SCRIPT_CONFUSABLE | USPOOF_ANY_CASE, t);
253 TEST_TEARDOWN;
254
255 /*
256 * get & setAllowedChars
257 */
258 TEST_SETUP
259 USet *us;
260 const USet *uset;
261
262 uset = uspoof_getAllowedChars(sc, &status);
263 TEST_ASSERT_SUCCESS(status);
264 TEST_ASSERT(uset_isFrozen(uset));
265 us = uset_open((UChar32)0x41, (UChar32)0x5A); /* [A-Z] */
266 uspoof_setAllowedChars(sc, us, &status);
267 TEST_ASSERT_SUCCESS(status);
268 TEST_ASSERT_NE(us, uspoof_getAllowedChars(sc, &status));
269 TEST_ASSERT(uset_equals(us, uspoof_getAllowedChars(sc, &status)));
270 TEST_ASSERT_SUCCESS(status);
271 uset_close(us);
272 TEST_TEARDOWN;
273
274 /*
275 * clone()
276 */
277
278 TEST_SETUP
279 USpoofChecker *clone1 = NULL;
280 USpoofChecker *clone2 = NULL;
281 int32_t checkResults = 0;
282
283 clone1 = uspoof_clone(sc, &status);
284 TEST_ASSERT_SUCCESS(status);
285 TEST_ASSERT_NE(clone1, sc);
286
287 clone2 = uspoof_clone(clone1, &status);
288 TEST_ASSERT_SUCCESS(status);
289 TEST_ASSERT_NE(clone2, clone1);
290
291 uspoof_close(clone1);
292
293 /* Verify that the cloned spoof checker is alive */
294 checkResults = uspoof_check(clone2, goodLatin, -1, NULL, &status);
295 TEST_ASSERT_SUCCESS(status);
296 TEST_ASSERT_EQ(0, checkResults);
297
298 checkResults = uspoof_check(clone2, scMixed, -1, NULL, &status);
299 TEST_ASSERT_SUCCESS(status);
300 TEST_ASSERT_EQ(USPOOF_SINGLE_SCRIPT | USPOOF_MIXED_SCRIPT_CONFUSABLE, checkResults);
301 uspoof_close(clone2);
302 TEST_TEARDOWN;
303
304 /*
305 * basic uspoof_check()
306 */
307 TEST_SETUP
308 int32_t result;
309 result = uspoof_check(sc, goodLatin, -1, NULL, &status);
310 TEST_ASSERT_SUCCESS(status);
311 TEST_ASSERT_EQ(0, result);
312
313 result = uspoof_check(sc, han_Hiragana, -1, NULL, &status);
314 TEST_ASSERT_SUCCESS(status);
315 TEST_ASSERT_EQ(0, result);
316
317 result = uspoof_check(sc, scMixed, -1, NULL, &status);
318 TEST_ASSERT_SUCCESS(status);
319 TEST_ASSERT_EQ(USPOOF_SINGLE_SCRIPT | USPOOF_MIXED_SCRIPT_CONFUSABLE, result);
320 TEST_TEARDOWN
321
322
323 /*
324 * get & set Checks
325 */
326 TEST_SETUP
327 int32_t checks;
328 int32_t checks2;
329 int32_t checkResults;
330
331 checks = uspoof_getChecks(sc, &status);
332 TEST_ASSERT_SUCCESS(status);
333 TEST_ASSERT_EQ(USPOOF_ALL_CHECKS, checks);
334
335 checks &= ~(USPOOF_SINGLE_SCRIPT | USPOOF_MIXED_SCRIPT_CONFUSABLE);
336 uspoof_setChecks(sc, checks, &status);
337 TEST_ASSERT_SUCCESS(status);
338 checks2 = uspoof_getChecks(sc, &status);
339 TEST_ASSERT_EQ(checks, checks2);
340
341 /* The checks that were disabled just above are the same ones that the "scMixed" test fails.
342 So with those tests gone checking that Identifier should now succeed */
343 checkResults = uspoof_check(sc, scMixed, -1, NULL, &status);
344 TEST_ASSERT_SUCCESS(status);
345 TEST_ASSERT_EQ(0, checkResults);
346 TEST_TEARDOWN;
347
348 /*
349 * AllowedLoacles
350 */
351
352 TEST_SETUP
353 const char *allowedLocales;
354 int32_t checkResults;
355
356 /* Default allowed locales list should be empty */
357 allowedLocales = uspoof_getAllowedLocales(sc, &status);
358 TEST_ASSERT_SUCCESS(status);
359 TEST_ASSERT(strcmp("", allowedLocales) == 0)
360
361 /* Allow en and ru, which should enable Latin and Cyrillic only to pass */
362 uspoof_setAllowedLocales(sc, "en, ru_RU", &status);
363 TEST_ASSERT_SUCCESS(status);
364 allowedLocales = uspoof_getAllowedLocales(sc, &status);
365 TEST_ASSERT_SUCCESS(status);
366 TEST_ASSERT(strstr(allowedLocales, "en") != NULL);
367 TEST_ASSERT(strstr(allowedLocales, "ru") != NULL);
368
369 /* Limit checks to USPOOF_CHAR_LIMIT. Some of the test data has whole script confusables also,
370 * which we don't want to see in this test. */
371 uspoof_setChecks(sc, USPOOF_CHAR_LIMIT, &status);
372 TEST_ASSERT_SUCCESS(status);
373
374 checkResults = uspoof_check(sc, goodLatin, -1, NULL, &status);
375 TEST_ASSERT_SUCCESS(status);
376 TEST_ASSERT_EQ(0, checkResults);
377
378 checkResults = uspoof_check(sc, goodGreek, -1, NULL, &status);
379 TEST_ASSERT_SUCCESS(status);
380 TEST_ASSERT_EQ(USPOOF_CHAR_LIMIT, checkResults);
381
382 checkResults = uspoof_check(sc, goodCyrl, -1, NULL, &status);
383 TEST_ASSERT_SUCCESS(status);
384 TEST_ASSERT_EQ(0, checkResults);
385
386 /* Reset with an empty locale list, which should allow all characters to pass */
387 uspoof_setAllowedLocales(sc, " ", &status);
388 TEST_ASSERT_SUCCESS(status);
389
390 checkResults = uspoof_check(sc, goodGreek, -1, NULL, &status);
391 TEST_ASSERT_SUCCESS(status);
392 TEST_ASSERT_EQ(0, checkResults);
393 TEST_TEARDOWN;
394
395 /*
396 * AllowedChars set/get the USet of allowed characters.
397 */
398 TEST_SETUP
399 const USet *set;
400 USet *tmpSet;
401 int32_t checkResults;
402
403 /* By default, we should see no restriction; the USet should allow all characters. */
404 set = uspoof_getAllowedChars(sc, &status);
405 TEST_ASSERT_SUCCESS(status);
406 tmpSet = uset_open(0, 0x10ffff);
407 TEST_ASSERT(uset_equals(tmpSet, set));
408
409 /* Setting the allowed chars should enable the check. */
410 uspoof_setChecks(sc, USPOOF_ALL_CHECKS & ~USPOOF_CHAR_LIMIT, &status);
411 TEST_ASSERT_SUCCESS(status);
412
413 /* Remove a character that is in our good Latin test identifier from the allowed chars set. */
414 uset_remove(tmpSet, goodLatin[1]);
415 uspoof_setAllowedChars(sc, tmpSet, &status);
416 TEST_ASSERT_SUCCESS(status);
417 uset_close(tmpSet);
418
419 /* Latin Identifier should now fail; other non-latin test cases should still be OK
420 * Note: fail of CHAR_LIMIT also causes the restriction level to be USPOOF_UNRESTRICTIVE
421 * which will give us a USPOOF_RESTRICTION_LEVEL failure.
422 */
423 checkResults = uspoof_check(sc, goodLatin, -1, NULL, &status);
424 TEST_ASSERT_SUCCESS(status);
425 TEST_ASSERT_EQ(USPOOF_CHAR_LIMIT | USPOOF_RESTRICTION_LEVEL, checkResults);
426
427 checkResults = uspoof_check(sc, goodGreek, -1, NULL, &status);
428 TEST_ASSERT_SUCCESS(status);
429 TEST_ASSERT_EQ(USPOOF_WHOLE_SCRIPT_CONFUSABLE, checkResults);
430 TEST_TEARDOWN;
431
432 /*
433 * check UTF-8
434 */
435 TEST_SETUP
436 char utf8buf[200];
437 int32_t checkResults;
438 int32_t position;
439
440 u_strToUTF8(utf8buf, sizeof(utf8buf), NULL, goodLatin, -1, &status);
441 TEST_ASSERT_SUCCESS(status);
442 position = 666;
443 checkResults = uspoof_checkUTF8(sc, utf8buf, -1, &position, &status);
444 TEST_ASSERT_SUCCESS(status);
445 TEST_ASSERT_EQ(0, checkResults);
446 TEST_ASSERT_EQ(0, position);
447
448 u_strToUTF8(utf8buf, sizeof(utf8buf), NULL, goodCyrl, -1, &status);
449 TEST_ASSERT_SUCCESS(status);
450 checkResults = uspoof_checkUTF8(sc, utf8buf, -1, &position, &status);
451 TEST_ASSERT_SUCCESS(status);
452 TEST_ASSERT_EQ(0, checkResults);
453
454 u_strToUTF8(utf8buf, sizeof(utf8buf), NULL, scMixed, -1, &status);
455 TEST_ASSERT_SUCCESS(status);
456 position = 666;
457 checkResults = uspoof_checkUTF8(sc, utf8buf, -1, &position, &status);
458 TEST_ASSERT_SUCCESS(status);
459 TEST_ASSERT_EQ(USPOOF_MIXED_SCRIPT_CONFUSABLE | USPOOF_SINGLE_SCRIPT , checkResults);
460 TEST_ASSERT_EQ(0, position);
461
462 TEST_TEARDOWN;
463
464 /*
465 * uspoof_areConfusable()
466 */
467 TEST_SETUP
468 int32_t checkResults;
469
470 checkResults = uspoof_areConfusable(sc, scLatin, -1, scMixed, -1, &status);
471 TEST_ASSERT_SUCCESS(status);
472 TEST_ASSERT_EQ(USPOOF_MIXED_SCRIPT_CONFUSABLE, checkResults);
473
474 checkResults = uspoof_areConfusable(sc, goodGreek, -1, scLatin, -1, &status);
475 TEST_ASSERT_SUCCESS(status);
476 TEST_ASSERT_EQ(0, checkResults);
477
478 checkResults = uspoof_areConfusable(sc, lll_Latin_a, -1, lll_Latin_b, -1, &status);
479 TEST_ASSERT_SUCCESS(status);
480 TEST_ASSERT_EQ(USPOOF_SINGLE_SCRIPT_CONFUSABLE, checkResults);
481
482 TEST_TEARDOWN;
483
484 /*
485 * areConfusableUTF8
486 */
487 TEST_SETUP
488 int32_t checkResults;
489 char s1[200];
490 char s2[200];
491
492
493 u_strToUTF8(s1, sizeof(s1), NULL, scLatin, -1, &status);
494 u_strToUTF8(s2, sizeof(s2), NULL, scMixed, -1, &status);
495 TEST_ASSERT_SUCCESS(status);
496 checkResults = uspoof_areConfusableUTF8(sc, s1, -1, s2, -1, &status);
497 TEST_ASSERT_SUCCESS(status);
498 TEST_ASSERT_EQ(USPOOF_MIXED_SCRIPT_CONFUSABLE, checkResults);
499
500 u_strToUTF8(s1, sizeof(s1), NULL, goodGreek, -1, &status);
501 u_strToUTF8(s2, sizeof(s2), NULL, scLatin, -1, &status);
502 TEST_ASSERT_SUCCESS(status);
503 checkResults = uspoof_areConfusableUTF8(sc, s1, -1, s2, -1, &status);
504 TEST_ASSERT_SUCCESS(status);
505 TEST_ASSERT_EQ(0, checkResults);
506
507 u_strToUTF8(s1, sizeof(s1), NULL, lll_Latin_a, -1, &status);
508 u_strToUTF8(s2, sizeof(s2), NULL, lll_Latin_b, -1, &status);
509 TEST_ASSERT_SUCCESS(status);
510 checkResults = uspoof_areConfusableUTF8(sc, s1, -1, s2, -1, &status);
511 TEST_ASSERT_SUCCESS(status);
512 TEST_ASSERT_EQ(USPOOF_SINGLE_SCRIPT_CONFUSABLE, checkResults);
513
514 TEST_TEARDOWN;
515
516
517 /*
518 * getSkeleton
519 */
520
521 TEST_SETUP
522 UChar dest[100];
523 int32_t skelLength;
524
525 skelLength = uspoof_getSkeleton(sc, USPOOF_ANY_CASE, lll_Latin_a, -1, dest, UPRV_LENGTHOF(dest), &status);
526 TEST_ASSERT_SUCCESS(status);
527 TEST_ASSERT_EQ(0, u_strcmp(lll_Skel, dest));
528 TEST_ASSERT_EQ(u_strlen(lll_Skel), skelLength);
529
530 skelLength = uspoof_getSkeletonUTF8(sc, USPOOF_ANY_CASE, goodLatinUTF8, -1, (char*)dest,
531 UPRV_LENGTHOF(dest), &status);
532 TEST_ASSERT_SUCCESS(status);
533
534 skelLength = uspoof_getSkeleton(sc, USPOOF_ANY_CASE, lll_Latin_a, -1, NULL, 0, &status);
535 TEST_ASSERT_EQ(U_BUFFER_OVERFLOW_ERROR, status);
536 TEST_ASSERT_EQ(3, skelLength);
537 status = U_ZERO_ERROR;
538
539 TEST_TEARDOWN;
540
541 /*
542 * get Inclusion and Recommended sets
543 */
544 TEST_SETUP
545 const USet *inclusions = NULL;
546 const USet *recommended = NULL;
547
548 inclusions = uspoof_getInclusionSet(&status);
549 TEST_ASSERT_SUCCESS(status);
550 TEST_ASSERT_EQ(TRUE, uset_isFrozen(inclusions));
551
552 status = U_ZERO_ERROR;
553 recommended = uspoof_getRecommendedSet(&status);
554 TEST_ASSERT_SUCCESS(status);
555 TEST_ASSERT_EQ(TRUE, uset_isFrozen(recommended));
556 TEST_TEARDOWN;
557
558 }
559
560 #endif /* UCONFIG_NO_REGULAR_EXPRESSIONS */