Lines Matching refs:status
32 #define TEST_ASSERT_SUCCESS(status) {if (U_FAILURE(status)) { \ argument
33 …ile %s, line %d, error = %s (Are you missing data?)\n", __FILE__, __LINE__, u_errorName(status));}}
51 status = U_ZERO_ERROR; \
52 re = uregex_openC(pattern, flags, NULL, &status); \
53 TEST_ASSERT_SUCCESS(status); \
56 uregex_setText(re, srcString, -1, &status); \
57 TEST_ASSERT_SUCCESS(status); \
58 if (U_SUCCESS(status)) {
62 TEST_ASSERT_SUCCESS(status); \
94 UErrorCode status = U_ZERO_ERROR; in test_assert_utext() local
96 utext_openUTF8(&expectedText, expected, -1, &status); in test_assert_utext()
168 UErrorCode status = U_ZERO_ERROR; in TestRegexCAPI() local
177 re = uregex_open(pat, -1, 0, 0, &status); in TestRegexCAPI()
178 if (U_FAILURE(status)) { in TestRegexCAPI()
179 …ssion, %s:%d, error is \"%s\" (Are you missing data?)\n", __FILE__, __LINE__, u_errorName(status)); in TestRegexCAPI()
185 status = U_ZERO_ERROR; in TestRegexCAPI()
188 0, &status); in TestRegexCAPI()
189 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
193 status = U_ZERO_ERROR; in TestRegexCAPI()
194 re = uregex_open(pat, -1, 0x40000000, 0, &status); in TestRegexCAPI()
195 TEST_ASSERT(status == U_REGEX_INVALID_FLAG); in TestRegexCAPI()
199 status = U_ZERO_ERROR; in TestRegexCAPI()
200 re = uregex_open(pat, -1, UREGEX_LITERAL, 0, &status); in TestRegexCAPI()
201 TEST_ASSERT(status == U_REGEX_UNIMPLEMENTED); in TestRegexCAPI()
205 status = U_ZERO_ERROR; in TestRegexCAPI()
207 …_CASE_INSENSITIVE | UREGEX_COMMENTS | UREGEX_DOTALL | UREGEX_MULTILINE | UREGEX_UWORD, 0, &status); in TestRegexCAPI()
208 TEST_ASSERT(status == U_ILLEGAL_ARGUMENT_ERROR && re == NULL); in TestRegexCAPI()
211 status = U_USELESS_COLLATOR_ERROR; in TestRegexCAPI()
213 …_CASE_INSENSITIVE | UREGEX_COMMENTS | UREGEX_DOTALL | UREGEX_MULTILINE | UREGEX_UWORD, 0, &status); in TestRegexCAPI()
214 TEST_ASSERT(status == U_USELESS_COLLATOR_ERROR && re == NULL); in TestRegexCAPI()
220 status = U_ZERO_ERROR; in TestRegexCAPI()
221 re = uregex_openC("abc*", 0, 0, &status); in TestRegexCAPI()
222 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
223 p = uregex_pattern(re, &len, &status); in TestRegexCAPI()
224 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
227 if(U_SUCCESS(status)) { in TestRegexCAPI()
250 status = U_ZERO_ERROR; in TestRegexCAPI()
251 re = uregex_openC("abc*", 0, 0, &status); in TestRegexCAPI()
252 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
253 clone1 = uregex_clone(re, &status); in TestRegexCAPI()
254 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
257 status = U_ZERO_ERROR; in TestRegexCAPI()
258 clone2 = uregex_clone(re, &status); in TestRegexCAPI()
259 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
263 status = U_ZERO_ERROR; in TestRegexCAPI()
264 clone3 = uregex_clone(clone2, &status); in TestRegexCAPI()
265 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
271 status = U_ZERO_ERROR; in TestRegexCAPI()
272 uregex_setText(clone1, testString1, -1, &status); in TestRegexCAPI()
273 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
274 result = uregex_lookingAt(clone1, 0, &status); in TestRegexCAPI()
275 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
278 status = U_ZERO_ERROR; in TestRegexCAPI()
279 uregex_setText(clone2, testString2, -1, &status); in TestRegexCAPI()
280 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
281 result = uregex_lookingAt(clone2, 0, &status); in TestRegexCAPI()
282 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
284 result = uregex_find(clone2, 0, &status); in TestRegexCAPI()
285 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
301 status = U_ZERO_ERROR; in TestRegexCAPI()
302 re = uregex_open(pat, -1, 0, NULL, &status); in TestRegexCAPI()
303 resultPat = uregex_pattern(re, &resultLen, &status); in TestRegexCAPI()
304 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
307 if (U_SUCCESS(status)) { in TestRegexCAPI()
314 status = U_ZERO_ERROR; in TestRegexCAPI()
315 re = uregex_open(pat, 3, 0, NULL, &status); in TestRegexCAPI()
316 resultPat = uregex_pattern(re, &resultLen, &status); in TestRegexCAPI()
317 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
318 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
321 if (U_SUCCESS(status)) { in TestRegexCAPI()
336 status = U_ZERO_ERROR; in TestRegexCAPI()
337 re = uregex_open(pat, -1, 0, NULL, &status); in TestRegexCAPI()
338 t = uregex_flags(re, &status); in TestRegexCAPI()
339 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
343 status = U_ZERO_ERROR; in TestRegexCAPI()
344 re = uregex_open(pat, -1, 0, NULL, &status); in TestRegexCAPI()
345 t = uregex_flags(re, &status); in TestRegexCAPI()
346 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
350 status = U_ZERO_ERROR; in TestRegexCAPI()
351 re = uregex_open(pat, -1, UREGEX_CASE_INSENSITIVE | UREGEX_DOTALL, NULL, &status); in TestRegexCAPI()
352 t = uregex_flags(re, &status); in TestRegexCAPI()
353 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
368 status = U_ZERO_ERROR; in TestRegexCAPI()
370 re = uregex_open(pat, -1, 0, NULL, &status); in TestRegexCAPI()
371 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
374 status = U_ZERO_ERROR; in TestRegexCAPI()
375 uregex_lookingAt(re, 0, &status); in TestRegexCAPI()
376 TEST_ASSERT( status== U_REGEX_INVALID_STATE); in TestRegexCAPI()
378 status = U_ZERO_ERROR; in TestRegexCAPI()
379 uregex_setText(re, text1, -1, &status); in TestRegexCAPI()
380 result = uregex_lookingAt(re, 0, &status); in TestRegexCAPI()
382 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
384 status = U_ZERO_ERROR; in TestRegexCAPI()
385 uregex_setText(re, text2, -1, &status); in TestRegexCAPI()
386 result = uregex_lookingAt(re, 0, &status); in TestRegexCAPI()
388 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
390 status = U_ZERO_ERROR; in TestRegexCAPI()
391 uregex_setText(re, text1, -1, &status); in TestRegexCAPI()
392 result = uregex_lookingAt(re, 0, &status); in TestRegexCAPI()
394 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
396 status = U_ZERO_ERROR; in TestRegexCAPI()
397 uregex_setText(re, text1, 5, &status); in TestRegexCAPI()
398 result = uregex_lookingAt(re, 0, &status); in TestRegexCAPI()
400 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
402 status = U_ZERO_ERROR; in TestRegexCAPI()
403 uregex_setText(re, text1, 6, &status); in TestRegexCAPI()
404 result = uregex_lookingAt(re, 0, &status); in TestRegexCAPI()
406 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
423 status = U_ZERO_ERROR; in TestRegexCAPI()
425 re = uregex_open(pat, -1, 0, NULL, &status); in TestRegexCAPI()
427 uregex_setText(re, text1, -1, &status); in TestRegexCAPI()
428 result = uregex_getText(re, &textLength, &status); in TestRegexCAPI()
431 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
433 status = U_ZERO_ERROR; in TestRegexCAPI()
434 uregex_setText(re, text2, 7, &status); in TestRegexCAPI()
435 result = uregex_getText(re, &textLength, &status); in TestRegexCAPI()
438 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
440 status = U_ZERO_ERROR; in TestRegexCAPI()
441 uregex_setText(re, text2, 4, &status); in TestRegexCAPI()
442 result = uregex_getText(re, &textLength, &status); in TestRegexCAPI()
445 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
459 status = U_ZERO_ERROR; in TestRegexCAPI()
461 re = uregex_open(pat, -1, 0, NULL, &status); in TestRegexCAPI()
463 uregex_setText(re, text1, -1, &status); in TestRegexCAPI()
464 result = uregex_matches(re, 0, &status); in TestRegexCAPI()
466 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
468 status = U_ZERO_ERROR; in TestRegexCAPI()
469 uregex_setText(re, text1, 6, &status); in TestRegexCAPI()
470 result = uregex_matches(re, 0, &status); in TestRegexCAPI()
472 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
474 status = U_ZERO_ERROR; in TestRegexCAPI()
475 uregex_setText(re, text1, 6, &status); in TestRegexCAPI()
476 result = uregex_matches(re, 1, &status); in TestRegexCAPI()
478 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
481 status = U_ZERO_ERROR; in TestRegexCAPI()
482 re = uregex_openC(".?", 0, NULL, &status); in TestRegexCAPI()
483 uregex_setText(re, text1, -1, &status); in TestRegexCAPI()
485 result = uregex_matches(re, len, &status); in TestRegexCAPI()
487 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
489 status = U_ZERO_ERROR; in TestRegexCAPI()
490 uregex_setText(re, nullString, -1, &status); in TestRegexCAPI()
491 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
492 result = uregex_matches(re, 0, &status); in TestRegexCAPI()
494 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
511 status = U_ZERO_ERROR; in TestRegexCAPI()
512 re = uregex_openC("rx", 0, NULL, &status); in TestRegexCAPI()
514 uregex_setText(re, text1, -1, &status); in TestRegexCAPI()
515 result = uregex_find(re, 0, &status); in TestRegexCAPI()
517 TEST_ASSERT(uregex_start(re, 0, &status) == 3); in TestRegexCAPI()
518 TEST_ASSERT(uregex_end(re, 0, &status) == 5); in TestRegexCAPI()
519 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
521 result = uregex_find(re, 9, &status); in TestRegexCAPI()
523 TEST_ASSERT(uregex_start(re, 0, &status) == 11); in TestRegexCAPI()
524 TEST_ASSERT(uregex_end(re, 0, &status) == 13); in TestRegexCAPI()
525 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
527 result = uregex_find(re, 14, &status); in TestRegexCAPI()
529 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
531 status = U_ZERO_ERROR; in TestRegexCAPI()
532 uregex_reset(re, 0, &status); in TestRegexCAPI()
534 result = uregex_findNext(re, &status); in TestRegexCAPI()
536 TEST_ASSERT(uregex_start(re, 0, &status) == 3); in TestRegexCAPI()
537 TEST_ASSERT(uregex_end(re, 0, &status) == 5); in TestRegexCAPI()
538 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
540 result = uregex_findNext(re, &status); in TestRegexCAPI()
542 TEST_ASSERT(uregex_start(re, 0, &status) == 6); in TestRegexCAPI()
543 TEST_ASSERT(uregex_end(re, 0, &status) == 8); in TestRegexCAPI()
544 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
546 status = U_ZERO_ERROR; in TestRegexCAPI()
547 uregex_reset(re, 12, &status); in TestRegexCAPI()
549 result = uregex_findNext(re, &status); in TestRegexCAPI()
551 TEST_ASSERT(uregex_start(re, 0, &status) == 13); in TestRegexCAPI()
552 TEST_ASSERT(uregex_end(re, 0, &status) == 15); in TestRegexCAPI()
553 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
555 result = uregex_findNext(re, &status); in TestRegexCAPI()
557 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
568 status = U_ZERO_ERROR; in TestRegexCAPI()
569 re = uregex_openC("abc", 0, NULL, &status); in TestRegexCAPI()
570 result = uregex_groupCount(re, &status); in TestRegexCAPI()
571 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
575 status = U_ZERO_ERROR; in TestRegexCAPI()
576 re = uregex_openC("abc(def)(ghi(j))", 0, NULL, &status); in TestRegexCAPI()
577 result = uregex_groupCount(re, &status); in TestRegexCAPI()
578 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
595 status = U_ZERO_ERROR; in TestRegexCAPI()
596 re = uregex_openC("abc(.*?)def", 0, NULL, &status); in TestRegexCAPI()
597 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
600 uregex_setText(re, text1, -1, &status); in TestRegexCAPI()
601 result = uregex_find(re, 0, &status); in TestRegexCAPI()
605 status = U_ZERO_ERROR; in TestRegexCAPI()
606 resultSz = uregex_group(re, 0, buf, sizeof(buf)/2, &status); in TestRegexCAPI()
607 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
612 status = U_ZERO_ERROR; in TestRegexCAPI()
613 resultSz = uregex_group(re, 1, buf, sizeof(buf)/2, &status); in TestRegexCAPI()
614 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
619 status = U_ZERO_ERROR; in TestRegexCAPI()
620 uregex_group(re, 2, buf, sizeof(buf)/2, &status); in TestRegexCAPI()
621 TEST_ASSERT(status == U_INDEX_OUTOFBOUNDS_ERROR); in TestRegexCAPI()
624 status = U_ZERO_ERROR; in TestRegexCAPI()
625 resultSz = uregex_group(re, 0, NULL, 0, &status); in TestRegexCAPI()
626 TEST_ASSERT(status == U_BUFFER_OVERFLOW_ERROR); in TestRegexCAPI()
630 status = U_ZERO_ERROR; in TestRegexCAPI()
632 resultSz = uregex_group(re, 0, buf, 5, &status); in TestRegexCAPI()
633 TEST_ASSERT(status == U_BUFFER_OVERFLOW_ERROR); in TestRegexCAPI()
639 status = U_ZERO_ERROR; in TestRegexCAPI()
640 resultSz = uregex_group(re, 0, buf, (int32_t)strlen("abc interior def"), &status); in TestRegexCAPI()
641 TEST_ASSERT(status == U_STRING_NOT_TERMINATED_WARNING); in TestRegexCAPI()
658 TEST_ASSERT(uregex_regionStart(re, &status) == 0); in TestRegexCAPI()
659 TEST_ASSERT(uregex_regionEnd(re, &status) == 16); in TestRegexCAPI()
660 uregex_setRegion(re, 3, 6, &status); in TestRegexCAPI()
661 TEST_ASSERT(uregex_regionStart(re, &status) == 3); in TestRegexCAPI()
662 TEST_ASSERT(uregex_regionEnd(re, &status) == 6); in TestRegexCAPI()
663 TEST_ASSERT(uregex_findNext(re, &status)); in TestRegexCAPI()
664 TEST_ASSERT(uregex_group(re, 0, resultString, sizeof(resultString)/2, &status) == 3) in TestRegexCAPI()
670 uregex_setRegion(re, 4, 6, &status); in TestRegexCAPI()
671 TEST_ASSERT(uregex_find(re, -1, &status) == TRUE); in TestRegexCAPI()
672 TEST_ASSERT(uregex_start(re, 0, &status) == 4); in TestRegexCAPI()
673 TEST_ASSERT(uregex_end(re, 0, &status) == 6); in TestRegexCAPI()
678 uregex_setRegion(re, 4, 6, &status); in TestRegexCAPI()
679 TEST_ASSERT(uregex_find(re, 0, &status) == TRUE); in TestRegexCAPI()
680 TEST_ASSERT(uregex_start(re, 0, &status) == 0); in TestRegexCAPI()
681 TEST_ASSERT(uregex_end(re, 0, &status) == 16); in TestRegexCAPI()
686 uregex_setRegion(re, 4, 6, &status); in TestRegexCAPI()
687 TEST_ASSERT(uregex_findNext(re,&status) == TRUE); in TestRegexCAPI()
688 TEST_ASSERT(uregex_start(re, 0, &status) == 4); in TestRegexCAPI()
689 TEST_ASSERT(uregex_findNext(re, &status) == TRUE); in TestRegexCAPI()
690 TEST_ASSERT(uregex_start(re, 0, &status) == 5); in TestRegexCAPI()
691 TEST_ASSERT(uregex_findNext(re, &status) == FALSE); in TestRegexCAPI()
697 uregex_setRegion(re, 4, 6, &status); in TestRegexCAPI()
698 TEST_ASSERT(uregex_matches(re, -1, &status) == TRUE); in TestRegexCAPI()
699 TEST_ASSERT(uregex_start(re, 0, &status) == 4); in TestRegexCAPI()
700 TEST_ASSERT(uregex_end(re, 0, &status) == 6); in TestRegexCAPI()
705 uregex_setRegion(re, 4, 6, &status); in TestRegexCAPI()
706 TEST_ASSERT(uregex_matches(re, 0, &status) == TRUE); in TestRegexCAPI()
707 TEST_ASSERT(uregex_start(re, 0, &status) == 0); in TestRegexCAPI()
708 TEST_ASSERT(uregex_end(re, 0, &status) == 16); in TestRegexCAPI()
714 uregex_setRegion(re, 4, 6, &status); in TestRegexCAPI()
715 TEST_ASSERT(uregex_lookingAt(re, -1, &status) == TRUE); in TestRegexCAPI()
716 TEST_ASSERT(uregex_start(re, 0, &status) == 4); in TestRegexCAPI()
717 TEST_ASSERT(uregex_end(re, 0, &status) == 4); in TestRegexCAPI()
722 uregex_setRegion(re, 4, 6, &status); in TestRegexCAPI()
723 TEST_ASSERT(uregex_lookingAt(re, 0, &status) == TRUE); in TestRegexCAPI()
724 TEST_ASSERT(uregex_start(re, 0, &status) == 0); in TestRegexCAPI()
725 TEST_ASSERT(uregex_end(re, 0, &status) == 0); in TestRegexCAPI()
730 TEST_ASSERT(uregex_find(re, 0, &status) == TRUE); in TestRegexCAPI()
731 TEST_ASSERT(uregex_hitEnd(re, &status) == FALSE); in TestRegexCAPI()
735 TEST_ASSERT(uregex_find(re, 0, &status) == TRUE); in TestRegexCAPI()
736 TEST_ASSERT(uregex_hitEnd(re, &status) == TRUE); in TestRegexCAPI()
741 TEST_ASSERT(uregex_find(re, 0, &status) == TRUE); in TestRegexCAPI()
742 TEST_ASSERT(uregex_requireEnd(re, &status) == FALSE); in TestRegexCAPI()
746 TEST_ASSERT(uregex_find(re, 0, &status) == TRUE); in TestRegexCAPI()
747 TEST_ASSERT(uregex_requireEnd(re, &status) == TRUE); in TestRegexCAPI()
752 TEST_ASSERT(uregex_hasAnchoringBounds(re, &status) == TRUE); in TestRegexCAPI()
753 uregex_useAnchoringBounds(re, FALSE, &status); in TestRegexCAPI()
754 TEST_ASSERT(uregex_hasAnchoringBounds(re, &status) == FALSE); in TestRegexCAPI()
756 TEST_ASSERT(uregex_find(re, -1, &status) == FALSE); in TestRegexCAPI()
757 uregex_useAnchoringBounds(re, TRUE, &status); in TestRegexCAPI()
758 uregex_setRegion(re, 0, 3, &status); in TestRegexCAPI()
759 TEST_ASSERT(uregex_find(re, -1, &status) == TRUE); in TestRegexCAPI()
760 TEST_ASSERT(uregex_end(re, 0, &status) == 3); in TestRegexCAPI()
765 TEST_ASSERT(uregex_hasTransparentBounds(re, &status) == FALSE); in TestRegexCAPI()
766 uregex_useTransparentBounds(re, TRUE, &status); in TestRegexCAPI()
767 TEST_ASSERT(uregex_hasTransparentBounds(re, &status) == TRUE); in TestRegexCAPI()
769 uregex_useTransparentBounds(re, FALSE, &status); in TestRegexCAPI()
770 TEST_ASSERT(uregex_find(re, -1, &status) == TRUE); /* No Region */ in TestRegexCAPI()
771 uregex_setRegion(re, 0, 3, &status); in TestRegexCAPI()
772 TEST_ASSERT(uregex_find(re, -1, &status) == FALSE); /* with region, opaque bounds */ in TestRegexCAPI()
773 uregex_useTransparentBounds(re, TRUE, &status); in TestRegexCAPI()
774 TEST_ASSERT(uregex_find(re, -1, &status) == TRUE); /* with region, transparent bounds */ in TestRegexCAPI()
775 TEST_ASSERT(uregex_end(re, 0, &status) == 3); in TestRegexCAPI()
792 status = U_ZERO_ERROR; in TestRegexCAPI()
793 re = uregex_openC("x(.*?)x", 0, NULL, &status); in TestRegexCAPI()
794 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
797 uregex_setText(re, text1, -1, &status); in TestRegexCAPI()
798 resultSz = uregex_replaceFirst(re, replText, -1, buf, sizeof(buf)/2, &status); in TestRegexCAPI()
799 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
804 status = U_ZERO_ERROR; in TestRegexCAPI()
805 uregex_setText(re, text2, -1, &status); in TestRegexCAPI()
806 resultSz = uregex_replaceFirst(re, replText, -1, buf, sizeof(buf)/2, &status); in TestRegexCAPI()
807 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
812 status = U_ZERO_ERROR; in TestRegexCAPI()
813 uregex_setText(re, text1, -1, &status); in TestRegexCAPI()
815 … resultSz = uregex_replaceFirst(re, replText, -1, buf, strlen("Replace <aa> x1x x...x."), &status); in TestRegexCAPI()
816 TEST_ASSERT(status == U_STRING_NOT_TERMINATED_WARNING); in TestRegexCAPI()
824 status = U_ZERO_ERROR; in TestRegexCAPI()
826 … resultSz = uregex_replaceFirst(re, replText, -1, buf, strlen("Replace <aa> x1x x...x."), &status); in TestRegexCAPI()
827 TEST_ASSERT(status == U_STRING_NOT_TERMINATED_WARNING); in TestRegexCAPI()
833 status = U_ZERO_ERROR; in TestRegexCAPI()
834 resultSz = uregex_replaceFirst(re, replText, -1, NULL, 0, &status); in TestRegexCAPI()
835 TEST_ASSERT(status == U_BUFFER_OVERFLOW_ERROR); in TestRegexCAPI()
839 status = U_ZERO_ERROR; in TestRegexCAPI()
841 …esultSz = uregex_replaceFirst(re, replText, -1, buf, strlen("Replace <aa> x1x x...x.")-1, &status); in TestRegexCAPI()
842 TEST_ASSERT(status == U_BUFFER_OVERFLOW_ERROR); in TestRegexCAPI()
875 status = U_ZERO_ERROR; in TestRegexCAPI()
876 re = uregex_openC(pattern, 0, NULL, &status); in TestRegexCAPI()
877 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
880 uregex_setText(re, text1, -1, &status); in TestRegexCAPI()
881 resultSize = uregex_replaceAll(re, replText, -1, buf, sizeof(buf)/2, &status); in TestRegexCAPI()
882 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
887 status = U_ZERO_ERROR; in TestRegexCAPI()
888 uregex_setText(re, text2, -1, &status); in TestRegexCAPI()
889 resultSize = uregex_replaceAll(re, replText, -1, buf, sizeof(buf)/2, &status); in TestRegexCAPI()
890 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
895 status = U_ZERO_ERROR; in TestRegexCAPI()
896 uregex_setText(re, text1, -1, &status); in TestRegexCAPI()
898 resultSize = uregex_replaceAll(re, replText, -1, buf, expectedResultSize, &status); in TestRegexCAPI()
899 TEST_ASSERT(status == U_STRING_NOT_TERMINATED_WARNING); in TestRegexCAPI()
907 status = U_ZERO_ERROR; in TestRegexCAPI()
909 … resultSize = uregex_replaceAll(re, replText, -1, buf, strlen("Replace xaax x1x x...x."), &status); in TestRegexCAPI()
910 TEST_ASSERT(status == U_STRING_NOT_TERMINATED_WARNING); in TestRegexCAPI()
916 status = U_ZERO_ERROR; in TestRegexCAPI()
917 resultSize = uregex_replaceAll(re, replText, -1, NULL, 0, &status); in TestRegexCAPI()
918 TEST_ASSERT(status == U_BUFFER_OVERFLOW_ERROR); in TestRegexCAPI()
925 status = U_ZERO_ERROR; in TestRegexCAPI()
927 resultSize = uregex_replaceAll(re, replText, -1, buf, i, &status); in TestRegexCAPI()
928 TEST_ASSERT(status == U_BUFFER_OVERFLOW_ERROR); in TestRegexCAPI()
942 status = U_ZERO_ERROR; in TestRegexCAPI()
944 resultSize = uregex_replaceAll(re, replText2, -1, buf, i, &status); in TestRegexCAPI()
945 TEST_ASSERT(status == U_BUFFER_OVERFLOW_ERROR); in TestRegexCAPI()
969 status = U_ZERO_ERROR; in TestRegexCAPI()
970 re = uregex_openC(".*", 0, 0, &status); in TestRegexCAPI()
971 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
975 uregex_setText(re, text, -1, &status); in TestRegexCAPI()
978 uregex_find(re, 0, &status); in TestRegexCAPI()
979 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
982 uregex_appendReplacement(re, repl, -1, &bufPtr, &bufCap, &status); in TestRegexCAPI()
983 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
987 uregex_find(re, 0, &status); in TestRegexCAPI()
988 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
992 uregex_appendReplacement(re, repl, -1, &bufPtr, &bufCap, &status); in TestRegexCAPI()
993 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
997 status = U_ZERO_ERROR; in TestRegexCAPI()
998 uregex_find(re, 0, &status); in TestRegexCAPI()
999 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
1001 status = U_BUFFER_OVERFLOW_ERROR; in TestRegexCAPI()
1002 uregex_appendReplacement(re, repl, -1, &bufPtr, NULL, &status); in TestRegexCAPI()
1003 TEST_ASSERT(status == U_BUFFER_OVERFLOW_ERROR); in TestRegexCAPI()
1029 status = U_ZERO_ERROR; in TestRegexCAPI()
1030 re = uregex_openC(":", 0, NULL, &status); in TestRegexCAPI()
1035 uregex_setText(re, textToSplit, -1, &status); in TestRegexCAPI()
1036 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
1039 if (U_SUCCESS(status)) { in TestRegexCAPI()
1042 uregex_split(re, buf, sizeof(buf)/2, &requiredCapacity, fields, 10, &status); in TestRegexCAPI()
1043 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
1046 if(U_SUCCESS(status)) { in TestRegexCAPI()
1065 status = U_ZERO_ERROR; in TestRegexCAPI()
1066 re = uregex_openC(":", 0, NULL, &status); in TestRegexCAPI()
1067 uregex_setText(re, textToSplit, -1, &status); in TestRegexCAPI()
1068 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
1071 if(U_SUCCESS(status)) { in TestRegexCAPI()
1074 uregex_split(re, buf, sizeof(buf)/2, &requiredCapacity, fields, 2, &status); in TestRegexCAPI()
1075 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
1078 if(U_SUCCESS(status)) { in TestRegexCAPI()
1097 status = U_ZERO_ERROR; in TestRegexCAPI()
1099 uregex_split(re, buf, sz, &requiredCapacity, fields, 10, &status); in TestRegexCAPI()
1101 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
1106 TEST_ASSERT(status == U_BUFFER_OVERFLOW_ERROR); in TestRegexCAPI()
1134 status = U_ZERO_ERROR; in TestRegexCAPI()
1135 re = uregex_openC("<(.*?)>", 0, NULL, &status); in TestRegexCAPI()
1137 uregex_setText(re, textToSplit, -1, &status); in TestRegexCAPI()
1138 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
1141 if(U_SUCCESS(status)) { in TestRegexCAPI()
1144 uregex_split(re, buf, sizeof(buf)/2, &requiredCapacity, fields, 10, &status); in TestRegexCAPI()
1145 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
1148 if(U_SUCCESS(status)) { in TestRegexCAPI()
1162 status = U_ZERO_ERROR; in TestRegexCAPI()
1165 uregex_split(re, buf, sizeof(buf)/2, &requiredCapacity, fields, 2, &status); in TestRegexCAPI()
1166 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
1169 if(U_SUCCESS(status)) { in TestRegexCAPI()
1180 status = U_ZERO_ERROR; in TestRegexCAPI()
1183 uregex_split(re, buf, sizeof(buf)/2, &requiredCapacity, fields, 3, &status); in TestRegexCAPI()
1184 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
1187 if(U_SUCCESS(status)) { in TestRegexCAPI()
1199 status = U_ZERO_ERROR; in TestRegexCAPI()
1202 uregex_split(re, buf, sizeof(buf)/2, &requiredCapacity, fields, 5, &status); in TestRegexCAPI()
1203 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
1206 if(U_SUCCESS(status)) { in TestRegexCAPI()
1220 status = U_ZERO_ERROR; in TestRegexCAPI()
1222 uregex_setText(re, textToSplit, sz, &status); in TestRegexCAPI()
1223 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
1226 if(U_SUCCESS(status)) { in TestRegexCAPI()
1229 uregex_split(re, buf, sizeof(buf)/2, &requiredCapacity, fields, 9, &status); in TestRegexCAPI()
1230 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
1233 if(U_SUCCESS(status)) { in TestRegexCAPI()
1254 TEST_ASSERT(uregex_getTimeLimit(re, &status) == 0); in TestRegexCAPI()
1255 uregex_setTimeLimit(re, 1000, &status); in TestRegexCAPI()
1256 TEST_ASSERT(uregex_getTimeLimit(re, &status) == 1000); in TestRegexCAPI()
1257 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
1258 uregex_setTimeLimit(re, -1, &status); in TestRegexCAPI()
1259 TEST_ASSERT(status == U_ILLEGAL_ARGUMENT_ERROR); in TestRegexCAPI()
1260 status = U_ZERO_ERROR; in TestRegexCAPI()
1261 TEST_ASSERT(uregex_getTimeLimit(re, &status) == 1000); in TestRegexCAPI()
1268 TEST_ASSERT(uregex_getStackLimit(re, &status) == 8000000); in TestRegexCAPI()
1269 uregex_setStackLimit(re, 40000, &status); in TestRegexCAPI()
1270 TEST_ASSERT(uregex_getStackLimit(re, &status) == 40000); in TestRegexCAPI()
1271 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
1272 uregex_setStackLimit(re, -1, &status); in TestRegexCAPI()
1273 TEST_ASSERT(status == U_ILLEGAL_ARGUMENT_ERROR); in TestRegexCAPI()
1274 status = U_ZERO_ERROR; in TestRegexCAPI()
1275 TEST_ASSERT(uregex_getStackLimit(re, &status) == 40000); in TestRegexCAPI()
1292 uregex_getMatchCallback(re, &returnedFn, &pContext, &status); in TestRegexCAPI()
1293 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
1299 uregex_setMatchCallback(re, &TestCallbackFn, &cbInfo, &status); in TestRegexCAPI()
1300 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
1302 TEST_ASSERT(uregex_matches(re, -1, &status) == FALSE); in TestRegexCAPI()
1303 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
1307 uregex_getMatchCallback(re, &returnedFn, &pContext, &status); in TestRegexCAPI()
1369 UErrorCode status = U_ZERO_ERROR; in TestUTextAPI() local
1376 utext_openUTF8(&patternText, patternTextUTF8, -1, &status); in TestUTextAPI()
1377 re = uregex_openUText(&patternText, 0, 0, &status); in TestUTextAPI()
1378 if (U_FAILURE(status)) { in TestUTextAPI()
1379 …ssion, %s:%d, error is \"%s\" (Are you missing data?)\n", __FILE__, __LINE__, u_errorName(status)); in TestUTextAPI()
1386 status = U_ZERO_ERROR; in TestUTextAPI()
1389 0, &status); in TestUTextAPI()
1390 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1394 status = U_ZERO_ERROR; in TestUTextAPI()
1395 re = uregex_openUText(&patternText, 0x40000000, 0, &status); in TestUTextAPI()
1396 TEST_ASSERT(status == U_REGEX_INVALID_FLAG); in TestUTextAPI()
1400 status = U_ZERO_ERROR; in TestUTextAPI()
1402 …_CASE_INSENSITIVE | UREGEX_COMMENTS | UREGEX_DOTALL | UREGEX_MULTILINE | UREGEX_UWORD, 0, &status); in TestUTextAPI()
1403 TEST_ASSERT(status == U_ILLEGAL_ARGUMENT_ERROR && re == NULL); in TestUTextAPI()
1417 status = U_ZERO_ERROR; in TestUTextAPI()
1418 re = uregex_openUText(&patternText, 0, 0, &status); in TestUTextAPI()
1419 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1420 clone1 = uregex_clone(re, &status); in TestUTextAPI()
1421 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1424 status = U_ZERO_ERROR; in TestUTextAPI()
1425 clone2 = uregex_clone(re, &status); in TestUTextAPI()
1426 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1430 status = U_ZERO_ERROR; in TestUTextAPI()
1431 clone3 = uregex_clone(clone2, &status); in TestUTextAPI()
1432 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1438 status = U_ZERO_ERROR; in TestUTextAPI()
1439 uregex_setText(clone1, testString1, -1, &status); in TestUTextAPI()
1440 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1441 result = uregex_lookingAt(clone1, 0, &status); in TestUTextAPI()
1442 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1445 status = U_ZERO_ERROR; in TestUTextAPI()
1446 uregex_setText(clone2, testString2, -1, &status); in TestUTextAPI()
1447 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1448 result = uregex_lookingAt(clone2, 0, &status); in TestUTextAPI()
1449 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1451 result = uregex_find(clone2, 0, &status); in TestUTextAPI()
1452 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1471 status = U_ZERO_ERROR; in TestUTextAPI()
1473 utext_openUTF8(&patternText, str_hello, -1, &status); in TestUTextAPI()
1474 re = uregex_open(pat, -1, 0, NULL, &status); in TestUTextAPI()
1475 resultPat = uregex_pattern(re, &resultLen, &status); in TestUTextAPI()
1476 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1479 if (U_SUCCESS(status)) { in TestUTextAPI()
1484 resultText = uregex_patternUText(re, &status); in TestUTextAPI()
1485 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1490 status = U_ZERO_ERROR; in TestUTextAPI()
1491 re = uregex_open(pat, 3, 0, NULL, &status); in TestUTextAPI()
1492 resultPat = uregex_pattern(re, &resultLen, &status); in TestUTextAPI()
1493 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1496 if (U_SUCCESS(status)) { in TestUTextAPI()
1502 resultText = uregex_patternUText(re, &status); in TestUTextAPI()
1503 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1519 status = U_ZERO_ERROR; in TestUTextAPI()
1520 utext_openUTF8(&text1, str_abcccd, -1, &status); in TestUTextAPI()
1521 utext_openUTF8(&text2, str_abcccxd, -1, &status); in TestUTextAPI()
1523 utext_openUTF8(&patternText, str_abcd, -1, &status); in TestUTextAPI()
1524 re = uregex_openUText(&patternText, 0, NULL, &status); in TestUTextAPI()
1525 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1528 status = U_ZERO_ERROR; in TestUTextAPI()
1529 uregex_lookingAt(re, 0, &status); in TestUTextAPI()
1530 TEST_ASSERT( status== U_REGEX_INVALID_STATE); in TestUTextAPI()
1532 status = U_ZERO_ERROR; in TestUTextAPI()
1533 uregex_setUText(re, &text1, &status); in TestUTextAPI()
1534 result = uregex_lookingAt(re, 0, &status); in TestUTextAPI()
1536 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1538 status = U_ZERO_ERROR; in TestUTextAPI()
1539 uregex_setUText(re, &text2, &status); in TestUTextAPI()
1540 result = uregex_lookingAt(re, 0, &status); in TestUTextAPI()
1542 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1544 status = U_ZERO_ERROR; in TestUTextAPI()
1545 uregex_setUText(re, &text1, &status); in TestUTextAPI()
1546 result = uregex_lookingAt(re, 0, &status); in TestUTextAPI()
1548 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1571 status = U_ZERO_ERROR; in TestUTextAPI()
1572 utext_openUTF8(&text1, str_abcccd, -1, &status); in TestUTextAPI()
1574 utext_openUChars(&text2, text2Chars, -1, &status); in TestUTextAPI()
1576 utext_openUTF8(&patternText, str_abcd, -1, &status); in TestUTextAPI()
1577 re = uregex_openUText(&patternText, 0, NULL, &status); in TestUTextAPI()
1580 uregex_setUText(re, &text1, &status); in TestUTextAPI()
1581 resultText = uregex_getUText(re, NULL, &status); in TestUTextAPI()
1582 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1589 result = uregex_getText(re, &textLength, &status); /* flattens UText into buffer */ in TestUTextAPI()
1591 resultText = uregex_getUText(re, NULL, &status); in TestUTextAPI()
1592 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1600 uregex_setText(re, text2Chars, 7, &status); in TestUTextAPI()
1601 resultText = uregex_getUText(re, NULL, &status); in TestUTextAPI()
1602 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1607 result = uregex_getText(re, &textLength, &status); in TestUTextAPI()
1625 status = U_ZERO_ERROR; in TestUTextAPI()
1626 utext_openUTF8(&text1, str_abcccde, -1, &status); in TestUTextAPI()
1627 utext_openUTF8(&patternText, str_abcd, -1, &status); in TestUTextAPI()
1628 re = uregex_openUText(&patternText, 0, NULL, &status); in TestUTextAPI()
1630 uregex_setUText(re, &text1, &status); in TestUTextAPI()
1631 result = uregex_matches(re, 0, &status); in TestUTextAPI()
1633 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1636 status = U_ZERO_ERROR; in TestUTextAPI()
1637 re = uregex_openC(".?", 0, NULL, &status); in TestUTextAPI()
1638 uregex_setUText(re, &text1, &status); in TestUTextAPI()
1639 result = uregex_matches(re, 7, &status); in TestUTextAPI()
1641 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1643 status = U_ZERO_ERROR; in TestUTextAPI()
1644 utext_openUTF8(&nullText, "", -1, &status); in TestUTextAPI()
1645 uregex_setUText(re, &nullText, &status); in TestUTextAPI()
1646 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1647 result = uregex_matches(re, 0, &status); in TestUTextAPI()
1649 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1669 status = U_ZERO_ERROR; in TestUTextAPI()
1670 re = uregex_openC("rx", 0, NULL, &status); in TestUTextAPI()
1672 uregex_setText(re, text1, -1, &status); in TestUTextAPI()
1673 result = uregex_find(re, 0, &status); in TestUTextAPI()
1675 TEST_ASSERT(uregex_start(re, 0, &status) == 3); in TestUTextAPI()
1676 TEST_ASSERT(uregex_end(re, 0, &status) == 5); in TestUTextAPI()
1677 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1679 result = uregex_find(re, 9, &status); in TestUTextAPI()
1681 TEST_ASSERT(uregex_start(re, 0, &status) == 11); in TestUTextAPI()
1682 TEST_ASSERT(uregex_end(re, 0, &status) == 13); in TestUTextAPI()
1683 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1685 result = uregex_find(re, 14, &status); in TestUTextAPI()
1687 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1689 status = U_ZERO_ERROR; in TestUTextAPI()
1690 uregex_reset(re, 0, &status); in TestUTextAPI()
1692 result = uregex_findNext(re, &status); in TestUTextAPI()
1694 TEST_ASSERT(uregex_start(re, 0, &status) == 3); in TestUTextAPI()
1695 TEST_ASSERT(uregex_end(re, 0, &status) == 5); in TestUTextAPI()
1696 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1698 result = uregex_findNext(re, &status); in TestUTextAPI()
1700 TEST_ASSERT(uregex_start(re, 0, &status) == 6); in TestUTextAPI()
1701 TEST_ASSERT(uregex_end(re, 0, &status) == 8); in TestUTextAPI()
1702 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1704 status = U_ZERO_ERROR; in TestUTextAPI()
1705 uregex_reset(re, 12, &status); in TestUTextAPI()
1707 result = uregex_findNext(re, &status); in TestUTextAPI()
1709 TEST_ASSERT(uregex_start(re, 0, &status) == 13); in TestUTextAPI()
1710 TEST_ASSERT(uregex_end(re, 0, &status) == 15); in TestUTextAPI()
1711 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1713 result = uregex_findNext(re, &status); in TestUTextAPI()
1715 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1734 status = U_ZERO_ERROR; in TestUTextAPI()
1735 re = uregex_openC("abc(.*?)def", 0, NULL, &status); in TestUTextAPI()
1736 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1738 uregex_setText(re, text1, -1, &status); in TestUTextAPI()
1739 result = uregex_find(re, 0, &status); in TestUTextAPI()
1743 status = U_ZERO_ERROR; in TestUTextAPI()
1744 actual = uregex_groupUText(re, 0, NULL, &status); in TestUTextAPI()
1745 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1750 status = U_ZERO_ERROR; in TestUTextAPI()
1751 actual = uregex_groupUText(re, 1, NULL, &status); in TestUTextAPI()
1752 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1757 status = U_ZERO_ERROR; in TestUTextAPI()
1758 actual = uregex_groupUText(re, 2, NULL, &status); in TestUTextAPI()
1759 TEST_ASSERT(status == U_INDEX_OUTOFBOUNDS_ERROR); in TestUTextAPI()
1780 status = U_ZERO_ERROR; in TestUTextAPI()
1783 utext_openUTF8(&replText, str_1x, -1, &status); in TestUTextAPI()
1785 re = uregex_openC("x(.*?)x", 0, NULL, &status); in TestUTextAPI()
1786 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1789 uregex_setText(re, text1, -1, &status); in TestUTextAPI()
1790 result = uregex_replaceFirstUText(re, &replText, NULL, &status); in TestUTextAPI()
1791 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1796 uregex_setText(re, text2, -1, &status); in TestUTextAPI()
1797 result = uregex_replaceFirstUText(re, &replText, NULL, &status); in TestUTextAPI()
1798 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1803 uregex_setText(re, text1, -1, &status); in TestUTextAPI()
1804 utext_openUTF8(&replText, str_u00411U00000042a, -1, &status); in TestUTextAPI()
1805 result = uregex_replaceFirstUText(re, &replText, NULL, &status); in TestUTextAPI()
1806 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1826 status = U_ZERO_ERROR; in TestUTextAPI()
1829 utext_openUTF8(&replText, str_1, -1, &status); in TestUTextAPI()
1831 re = uregex_openC("x(.*?)x", 0, NULL, &status); in TestUTextAPI()
1832 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1835 uregex_setText(re, text1, -1, &status); in TestUTextAPI()
1836 result = uregex_replaceAllUText(re, &replText, NULL, &status); in TestUTextAPI()
1837 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1842 uregex_setText(re, text2, -1, &status); in TestUTextAPI()
1843 result = uregex_replaceAllUText(re, &replText, NULL, &status); in TestUTextAPI()
1844 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1863 status = U_ZERO_ERROR; in TestUTextAPI()
1864 re = uregex_openC(".*", 0, 0, &status); in TestUTextAPI()
1865 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1869 uregex_setText(re, text, -1, &status); in TestUTextAPI()
1872 uregex_find(re, 0, &status); in TestUTextAPI()
1873 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1876 uregex_appendReplacement(re, repl, -1, &bufPtr, &bufCap, &status); in TestUTextAPI()
1877 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1881 uregex_find(re, 0, &status); in TestUTextAPI()
1882 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1886 uregex_appendReplacement(re, repl, -1, &bufPtr, &bufCap, &status); in TestUTextAPI()
1887 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1911 status = U_ZERO_ERROR; in TestUTextAPI()
1912 re = uregex_openC(":", 0, NULL, &status); in TestUTextAPI()
1917 uregex_setText(re, textToSplit, -1, &status); in TestUTextAPI()
1918 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1921 if (U_SUCCESS(status)) { in TestUTextAPI()
1923 numFields = uregex_splitUText(re, fields, 10, &status); in TestUTextAPI()
1924 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1927 if(U_SUCCESS(status)) { in TestUTextAPI()
1946 status = U_ZERO_ERROR; in TestUTextAPI()
1947 re = uregex_openC(":", 0, NULL, &status); in TestUTextAPI()
1948 uregex_setText(re, textToSplit, -1, &status); in TestUTextAPI()
1949 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1952 if(U_SUCCESS(status)) { in TestUTextAPI()
1956 numFields = uregex_splitUText(re, fields, 2, &status); in TestUTextAPI()
1957 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1960 if(U_SUCCESS(status)) { in TestUTextAPI()
1986 status = U_ZERO_ERROR; in TestUTextAPI()
1987 re = uregex_openC("<(.*?)>", 0, NULL, &status); in TestUTextAPI()
1989 uregex_setText(re, textToSplit, -1, &status); in TestUTextAPI()
1990 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1993 if(U_SUCCESS(status)) { in TestUTextAPI()
1995 numFields = uregex_splitUText(re, fields, 10, &status); in TestUTextAPI()
1996 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1999 if(U_SUCCESS(status)) { in TestUTextAPI()
2020 status = U_ZERO_ERROR; in TestUTextAPI()
2024 numFields = uregex_splitUText(re, fields, 2, &status); in TestUTextAPI()
2025 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
2028 if(U_SUCCESS(status)) { in TestUTextAPI()
2042 status = U_ZERO_ERROR; in TestUTextAPI()
2047 numFields = uregex_splitUText(re, fields, 3, &status); in TestUTextAPI()
2048 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
2051 if(U_SUCCESS(status)) { in TestUTextAPI()
2066 status = U_ZERO_ERROR; in TestUTextAPI()
2073 numFields = uregex_splitUText(re, fields, 5, &status); in TestUTextAPI()
2074 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
2077 if(U_SUCCESS(status)) { in TestUTextAPI()
2097 status = U_ZERO_ERROR; in TestUTextAPI()
2098 uregex_setText(re, textToSplit, strlen("first <tag-a> second<tag-b>"), &status); in TestUTextAPI()
2099 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
2102 if(U_SUCCESS(status)) { in TestUTextAPI()
2105 numFields = uregex_splitUText(re, fields, 9, &status); in TestUTextAPI()
2106 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
2109 if(U_SUCCESS(status)) { in TestUTextAPI()
2147 UErrorCode status = U_ZERO_ERROR; in TestRefreshInput() local
2152 re = uregex_openC("[ABC]", 0, 0, &status); in TestRefreshInput()
2153 TEST_ASSERT_SUCCESS(status); in TestRefreshInput()
2155 utext_openUChars(&ut1, testStr, -1, &status); in TestRefreshInput()
2156 TEST_ASSERT_SUCCESS(status); in TestRefreshInput()
2157 uregex_setUText(re, &ut1, &status); in TestRefreshInput()
2158 TEST_ASSERT_SUCCESS(status); in TestRefreshInput()
2161 TEST_ASSERT(uregex_findNext(re, &status)); in TestRefreshInput()
2162 TEST_ASSERT(uregex_start(re, 0, &status) == 0); in TestRefreshInput()
2167 utext_openUChars(&ut2, movedStr, -1, &status); in TestRefreshInput()
2168 TEST_ASSERT_SUCCESS(status); in TestRefreshInput()
2169 uregex_refreshUText(re, &ut2, &status); in TestRefreshInput()
2170 TEST_ASSERT_SUCCESS(status); in TestRefreshInput()
2173 TEST_ASSERT(uregex_findNext(re, &status)); in TestRefreshInput()
2174 TEST_ASSERT(uregex_start(re, 0, &status) == 2); in TestRefreshInput()
2175 TEST_ASSERT(uregex_findNext(re, &status)); in TestRefreshInput()
2176 TEST_ASSERT(uregex_start(re, 0, &status) == 4); in TestRefreshInput()
2177 TEST_ASSERT(FALSE == uregex_findNext(re, &status)); in TestRefreshInput()