Lines Matching full:status
34 #define TEST_ASSERT_SUCCESS(status) {if (U_FAILURE(status)) { \ argument
35 …log_err_status(status, "Failure at file %s, line %d, error = %s\n", __FILE__, __LINE__, u_errorNam…
56 UErrorCode status = U_ZERO_ERROR; \
58 sc = uspoof_open(&status); \
59 TEST_ASSERT_SUCCESS(status); \
60 if (U_SUCCESS(status)){
64 TEST_ASSERT_SUCCESS(status); \
114 UErrorCode status = U_ZERO_ERROR; in TestOpenFromSource() local
151 &errType, &pe, &status); in TestOpenFromSource()
152 TEST_ASSERT_SUCCESS(status); in TestOpenFromSource()
156 checkResults = uspoof_check(rsc, goodLatin, -1, NULL, &status); in TestOpenFromSource()
157 TEST_ASSERT_SUCCESS(status); in TestOpenFromSource()
177 UErrorCode status = U_ZERO_ERROR; in TestUSpoofCAPI() local
178 sc = uspoof_open(&status); in TestUSpoofCAPI()
179 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
180 if (U_FAILURE(status)) { in TestUSpoofCAPI()
199 serializedSize = uspoof_serialize(sc, NULL, 0, &status); in TestUSpoofCAPI()
200 TEST_ASSERT_EQ(status, U_BUFFER_OVERFLOW_ERROR); in TestUSpoofCAPI()
204 status = U_ZERO_ERROR; in TestUSpoofCAPI()
208 uspoof_serialize(sc, buf, serializedSize, &status); in TestUSpoofCAPI()
209 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
213 sc2 = uspoof_openFromSerialized(buf, serializedSize+10, &actualLength, &status); in TestUSpoofCAPI()
214 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
219 checkResults = uspoof_check(sc2, goodLatin, -1, NULL, &status); in TestUSpoofCAPI()
220 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
223 checkResults = uspoof_check(sc2, scMixed, -1, NULL, &status); in TestUSpoofCAPI()
224 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
238 uspoof_setChecks(sc, USPOOF_ALL_CHECKS, &status); in TestUSpoofCAPI()
239 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
240 t = uspoof_getChecks(sc, &status); in TestUSpoofCAPI()
243 uspoof_setChecks(sc, 0, &status); in TestUSpoofCAPI()
244 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
245 t = uspoof_getChecks(sc, &status); in TestUSpoofCAPI()
250 &status); in TestUSpoofCAPI()
251 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
252 t = uspoof_getChecks(sc, &status); in TestUSpoofCAPI()
253 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
264 uset = uspoof_getAllowedChars(sc, &status); in TestUSpoofCAPI()
265 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
268 uspoof_setAllowedChars(sc, us, &status); in TestUSpoofCAPI()
269 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
270 TEST_ASSERT_NE(us, uspoof_getAllowedChars(sc, &status)); in TestUSpoofCAPI()
271 TEST_ASSERT(uset_equals(us, uspoof_getAllowedChars(sc, &status))); in TestUSpoofCAPI()
272 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
285 clone1 = uspoof_clone(sc, &status); in TestUSpoofCAPI()
286 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
289 clone2 = uspoof_clone(clone1, &status); in TestUSpoofCAPI()
290 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
296 checkResults = uspoof_check(clone2, goodLatin, -1, NULL, &status); in TestUSpoofCAPI()
297 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
300 checkResults = uspoof_check(clone2, scMixed, -1, NULL, &status); in TestUSpoofCAPI()
301 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
311 result = uspoof_check(sc, goodLatin, -1, NULL, &status); in TestUSpoofCAPI()
312 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
315 result = uspoof_check(sc, han_Hiragana, -1, NULL, &status); in TestUSpoofCAPI()
316 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
319 result = uspoof_check(sc, scMixed, -1, NULL, &status); in TestUSpoofCAPI()
320 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
333 checks = uspoof_getChecks(sc, &status); in TestUSpoofCAPI()
334 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
338 uspoof_setChecks(sc, checks, &status); in TestUSpoofCAPI()
339 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
340 checks2 = uspoof_getChecks(sc, &status); in TestUSpoofCAPI()
345 checkResults = uspoof_check(sc, scMixed, -1, NULL, &status); in TestUSpoofCAPI()
346 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
359 allowedLocales = uspoof_getAllowedLocales(sc, &status); in TestUSpoofCAPI()
360 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
364 uspoof_setAllowedLocales(sc, "en, ru_RU", &status); in TestUSpoofCAPI()
365 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
366 allowedLocales = uspoof_getAllowedLocales(sc, &status); in TestUSpoofCAPI()
367 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
373 uspoof_setChecks(sc, USPOOF_CHAR_LIMIT, &status); in TestUSpoofCAPI()
374 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
376 checkResults = uspoof_check(sc, goodLatin, -1, NULL, &status); in TestUSpoofCAPI()
377 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
380 checkResults = uspoof_check(sc, goodGreek, -1, NULL, &status); in TestUSpoofCAPI()
381 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
384 checkResults = uspoof_check(sc, goodCyrl, -1, NULL, &status); in TestUSpoofCAPI()
385 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
389 uspoof_setAllowedLocales(sc, " ", &status); in TestUSpoofCAPI()
390 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
392 checkResults = uspoof_check(sc, goodGreek, -1, NULL, &status); in TestUSpoofCAPI()
393 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
406 set = uspoof_getAllowedChars(sc, &status); in TestUSpoofCAPI()
407 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
412 uspoof_setChecks(sc, USPOOF_ALL_CHECKS & ~USPOOF_CHAR_LIMIT, &status); in TestUSpoofCAPI()
413 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
417 uspoof_setAllowedChars(sc, tmpSet, &status); in TestUSpoofCAPI()
418 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
425 checkResults = uspoof_check(sc, goodLatin, -1, NULL, &status); in TestUSpoofCAPI()
426 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
429 checkResults = uspoof_check(sc, goodGreek, -1, NULL, &status); in TestUSpoofCAPI()
430 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
442 u_strToUTF8(utf8buf, sizeof(utf8buf), NULL, goodLatin, -1, &status); in TestUSpoofCAPI()
443 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
445 checkResults = uspoof_checkUTF8(sc, utf8buf, -1, &position, &status); in TestUSpoofCAPI()
446 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
450 u_strToUTF8(utf8buf, sizeof(utf8buf), NULL, goodCyrl, -1, &status); in TestUSpoofCAPI()
451 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
452 checkResults = uspoof_checkUTF8(sc, utf8buf, -1, &position, &status); in TestUSpoofCAPI()
453 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
456 u_strToUTF8(utf8buf, sizeof(utf8buf), NULL, scMixed, -1, &status); in TestUSpoofCAPI()
457 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
459 checkResults = uspoof_checkUTF8(sc, utf8buf, -1, &position, &status); in TestUSpoofCAPI()
460 checkResults2 = uspoof_check(sc, scMixed, -1, NULL, &status); in TestUSpoofCAPI()
461 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
474 uspoof_setChecks(sc, USPOOF_ALL_CHECKS | USPOOF_AUX_INFO, &status); in TestUSpoofCAPI()
475 USpoofCheckResult* checkResult = uspoof_openCheckResult(&status); in TestUSpoofCAPI()
476 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
485 result1 = uspoof_check(sc, str, -1, NULL, &status); in TestUSpoofCAPI()
486 result2 = uspoof_check2(sc, str, -1, NULL, &status); in TestUSpoofCAPI()
487 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
491 result1 = uspoof_check(sc, str, -1, NULL, &status); in TestUSpoofCAPI()
492 result2 = uspoof_check2(sc, str, -1, checkResult, &status); in TestUSpoofCAPI()
493 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
497 … TEST_ASSERT_EQ(result1 & USPOOF_ALL_CHECKS, uspoof_getCheckResultChecks(checkResult, &status)); in TestUSpoofCAPI()
500 … URestrictionLevel restrictionLevel = uspoof_getCheckResultRestrictionLevel(checkResult, &status); in TestUSpoofCAPI()
504 u_strToUTF8(utf8buf, sizeof(utf8buf), NULL, goodLatin, -1, &status); in TestUSpoofCAPI()
505 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
506 result1 = uspoof_checkUTF8(sc, utf8buf, -1, NULL, &status); in TestUSpoofCAPI()
507 result2 = uspoof_check2UTF8(sc, utf8buf, -1, NULL, &status); in TestUSpoofCAPI()
508 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
521 checkResults = uspoof_areConfusable(sc, scLatin, -1, scMixed, -1, &status); in TestUSpoofCAPI()
522 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
525 checkResults = uspoof_areConfusable(sc, goodGreek, -1, scLatin, -1, &status); in TestUSpoofCAPI()
526 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
529 checkResults = uspoof_areConfusable(sc, lll_Latin_a, -1, lll_Latin_b, -1, &status); in TestUSpoofCAPI()
530 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
544 u_strToUTF8(s1, sizeof(s1), NULL, scLatin, -1, &status); in TestUSpoofCAPI()
545 u_strToUTF8(s2, sizeof(s2), NULL, scMixed, -1, &status); in TestUSpoofCAPI()
546 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
547 checkResults = uspoof_areConfusableUTF8(sc, s1, -1, s2, -1, &status); in TestUSpoofCAPI()
548 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
551 u_strToUTF8(s1, sizeof(s1), NULL, goodGreek, -1, &status); in TestUSpoofCAPI()
552 u_strToUTF8(s2, sizeof(s2), NULL, scLatin, -1, &status); in TestUSpoofCAPI()
553 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
554 checkResults = uspoof_areConfusableUTF8(sc, s1, -1, s2, -1, &status); in TestUSpoofCAPI()
555 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
558 u_strToUTF8(s1, sizeof(s1), NULL, lll_Latin_a, -1, &status); in TestUSpoofCAPI()
559 u_strToUTF8(s2, sizeof(s2), NULL, lll_Latin_b, -1, &status); in TestUSpoofCAPI()
560 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
561 checkResults = uspoof_areConfusableUTF8(sc, s1, -1, s2, -1, &status); in TestUSpoofCAPI()
562 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
576 …gth = uspoof_getSkeleton(sc, USPOOF_ANY_CASE, lll_Latin_a, -1, dest, UPRV_LENGTHOF(dest), &status); in TestUSpoofCAPI()
577 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
582 UPRV_LENGTHOF(dest), &status); in TestUSpoofCAPI()
583 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
585 skelLength = uspoof_getSkeleton(sc, USPOOF_ANY_CASE, lll_Latin_a, -1, NULL, 0, &status); in TestUSpoofCAPI()
586 TEST_ASSERT_EQ(U_BUFFER_OVERFLOW_ERROR, status); in TestUSpoofCAPI()
588 status = U_ZERO_ERROR; in TestUSpoofCAPI()
599 inclusions = uspoof_getInclusionSet(&status); in TestUSpoofCAPI()
600 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()
603 status = U_ZERO_ERROR; in TestUSpoofCAPI()
604 recommended = uspoof_getRecommendedSet(&status); in TestUSpoofCAPI()
605 TEST_ASSERT_SUCCESS(status); in TestUSpoofCAPI()