Lines Matching refs:status

35 #define TEST_ASSERT_SUCCESS(status) {if (U_FAILURE(status)) { \  argument
36 … at file %s:%d - error = %s (Are you missing data?)\n", __FILE__, __LINE__, u_errorName(status));}}
54 status = U_ZERO_ERROR; \
55 re = uregex_openC(pattern, flags, NULL, &status); \
56 TEST_ASSERT_SUCCESS(status); \
59 uregex_setText(re, srcString, -1, &status); \
60 TEST_ASSERT_SUCCESS(status); \
61 if (U_SUCCESS(status)) {
65 TEST_ASSERT_SUCCESS(status); \
204 UErrorCode status = U_ZERO_ERROR; in TestRegexCAPI() local
213 re = uregex_open(pat, -1, 0, 0, &status); in TestRegexCAPI()
214 if (U_FAILURE(status)) { in TestRegexCAPI()
215 …ssion, %s:%d, error is \"%s\" (Are you missing data?)\n", __FILE__, __LINE__, u_errorName(status)); in TestRegexCAPI()
221 status = U_ZERO_ERROR; in TestRegexCAPI()
224 0, &status); in TestRegexCAPI()
225 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
229 status = U_ZERO_ERROR; in TestRegexCAPI()
230 re = uregex_open(pat, -1, 0x40000000, 0, &status); in TestRegexCAPI()
231 TEST_ASSERT(status == U_REGEX_INVALID_FLAG); in TestRegexCAPI()
235 status = U_ZERO_ERROR; in TestRegexCAPI()
236 re = uregex_open(pat, -1, UREGEX_CANON_EQ, 0, &status); in TestRegexCAPI()
237 TEST_ASSERT(status == U_REGEX_UNIMPLEMENTED); in TestRegexCAPI()
241 status = U_ZERO_ERROR; in TestRegexCAPI()
243 …_CASE_INSENSITIVE | UREGEX_COMMENTS | UREGEX_DOTALL | UREGEX_MULTILINE | UREGEX_UWORD, 0, &status); in TestRegexCAPI()
244 TEST_ASSERT(status == U_ILLEGAL_ARGUMENT_ERROR && re == NULL); in TestRegexCAPI()
247 status = U_USELESS_COLLATOR_ERROR; in TestRegexCAPI()
249 …_CASE_INSENSITIVE | UREGEX_COMMENTS | UREGEX_DOTALL | UREGEX_MULTILINE | UREGEX_UWORD, 0, &status); in TestRegexCAPI()
250 TEST_ASSERT(status == U_USELESS_COLLATOR_ERROR && re == NULL); in TestRegexCAPI()
256 status = U_ZERO_ERROR; in TestRegexCAPI()
257 re = uregex_openC("abc*", 0, 0, &status); in TestRegexCAPI()
258 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
259 p = uregex_pattern(re, &len, &status); in TestRegexCAPI()
260 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
263 if(U_SUCCESS(status)) { in TestRegexCAPI()
286 status = U_ZERO_ERROR; in TestRegexCAPI()
287 re = uregex_openC("abc*", 0, 0, &status); in TestRegexCAPI()
288 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
289 clone1 = uregex_clone(re, &status); in TestRegexCAPI()
290 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
293 status = U_ZERO_ERROR; in TestRegexCAPI()
294 clone2 = uregex_clone(re, &status); in TestRegexCAPI()
295 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
299 status = U_ZERO_ERROR; in TestRegexCAPI()
300 clone3 = uregex_clone(clone2, &status); in TestRegexCAPI()
301 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
307 status = U_ZERO_ERROR; in TestRegexCAPI()
308 uregex_setText(clone1, testString1, -1, &status); in TestRegexCAPI()
309 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
310 result = uregex_lookingAt(clone1, 0, &status); in TestRegexCAPI()
311 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
314 status = U_ZERO_ERROR; in TestRegexCAPI()
315 uregex_setText(clone2, testString2, -1, &status); in TestRegexCAPI()
316 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
317 result = uregex_lookingAt(clone2, 0, &status); in TestRegexCAPI()
318 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
320 result = uregex_find(clone2, 0, &status); in TestRegexCAPI()
321 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
337 status = U_ZERO_ERROR; in TestRegexCAPI()
338 re = uregex_open(pat, -1, 0, NULL, &status); in TestRegexCAPI()
339 resultPat = uregex_pattern(re, &resultLen, &status); in TestRegexCAPI()
340 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
343 if (U_SUCCESS(status)) { in TestRegexCAPI()
350 status = U_ZERO_ERROR; in TestRegexCAPI()
351 re = uregex_open(pat, 3, 0, NULL, &status); in TestRegexCAPI()
352 resultPat = uregex_pattern(re, &resultLen, &status); in TestRegexCAPI()
353 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
354 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
357 if (U_SUCCESS(status)) { in TestRegexCAPI()
372 status = U_ZERO_ERROR; in TestRegexCAPI()
373 re = uregex_open(pat, -1, 0, NULL, &status); in TestRegexCAPI()
374 t = uregex_flags(re, &status); in TestRegexCAPI()
375 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
379 status = U_ZERO_ERROR; in TestRegexCAPI()
380 re = uregex_open(pat, -1, 0, NULL, &status); in TestRegexCAPI()
381 t = uregex_flags(re, &status); in TestRegexCAPI()
382 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
386 status = U_ZERO_ERROR; in TestRegexCAPI()
387 re = uregex_open(pat, -1, UREGEX_CASE_INSENSITIVE | UREGEX_DOTALL, NULL, &status); in TestRegexCAPI()
388 t = uregex_flags(re, &status); in TestRegexCAPI()
389 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
404 status = U_ZERO_ERROR; in TestRegexCAPI()
406 re = uregex_open(pat, -1, 0, NULL, &status); in TestRegexCAPI()
407 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
410 status = U_ZERO_ERROR; in TestRegexCAPI()
411 uregex_lookingAt(re, 0, &status); in TestRegexCAPI()
412 TEST_ASSERT( status== U_REGEX_INVALID_STATE); in TestRegexCAPI()
414 status = U_ZERO_ERROR; in TestRegexCAPI()
415 uregex_setText(re, text1, -1, &status); in TestRegexCAPI()
416 result = uregex_lookingAt(re, 0, &status); in TestRegexCAPI()
418 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
420 status = U_ZERO_ERROR; in TestRegexCAPI()
421 uregex_setText(re, text2, -1, &status); in TestRegexCAPI()
422 result = uregex_lookingAt(re, 0, &status); in TestRegexCAPI()
424 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
426 status = U_ZERO_ERROR; in TestRegexCAPI()
427 uregex_setText(re, text1, -1, &status); in TestRegexCAPI()
428 result = uregex_lookingAt(re, 0, &status); in TestRegexCAPI()
430 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
432 status = U_ZERO_ERROR; in TestRegexCAPI()
433 uregex_setText(re, text1, 5, &status); in TestRegexCAPI()
434 result = uregex_lookingAt(re, 0, &status); in TestRegexCAPI()
436 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
438 status = U_ZERO_ERROR; in TestRegexCAPI()
439 uregex_setText(re, text1, 6, &status); in TestRegexCAPI()
440 result = uregex_lookingAt(re, 0, &status); in TestRegexCAPI()
442 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_getText(re, &textLength, &status); in TestRegexCAPI()
467 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
469 status = U_ZERO_ERROR; in TestRegexCAPI()
470 uregex_setText(re, text2, 7, &status); in TestRegexCAPI()
471 result = uregex_getText(re, &textLength, &status); in TestRegexCAPI()
474 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
476 status = U_ZERO_ERROR; in TestRegexCAPI()
477 uregex_setText(re, text2, 4, &status); in TestRegexCAPI()
478 result = uregex_getText(re, &textLength, &status); in TestRegexCAPI()
481 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
495 status = U_ZERO_ERROR; in TestRegexCAPI()
497 re = uregex_open(pat, -1, 0, NULL, &status); in TestRegexCAPI()
499 uregex_setText(re, text1, -1, &status); in TestRegexCAPI()
500 result = uregex_matches(re, 0, &status); in TestRegexCAPI()
502 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
504 status = U_ZERO_ERROR; in TestRegexCAPI()
505 uregex_setText(re, text1, 6, &status); in TestRegexCAPI()
506 result = uregex_matches(re, 0, &status); in TestRegexCAPI()
508 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
510 status = U_ZERO_ERROR; in TestRegexCAPI()
511 uregex_setText(re, text1, 6, &status); in TestRegexCAPI()
512 result = uregex_matches(re, 1, &status); in TestRegexCAPI()
514 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
517 status = U_ZERO_ERROR; in TestRegexCAPI()
518 re = uregex_openC(".?", 0, NULL, &status); in TestRegexCAPI()
519 uregex_setText(re, text1, -1, &status); in TestRegexCAPI()
521 result = uregex_matches(re, len, &status); in TestRegexCAPI()
523 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
525 status = U_ZERO_ERROR; in TestRegexCAPI()
526 uregex_setText(re, nullString, -1, &status); in TestRegexCAPI()
527 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
528 result = uregex_matches(re, 0, &status); in TestRegexCAPI()
530 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
547 status = U_ZERO_ERROR; in TestRegexCAPI()
548 re = uregex_openC("rx", 0, NULL, &status); in TestRegexCAPI()
550 uregex_setText(re, text1, -1, &status); in TestRegexCAPI()
551 result = uregex_find(re, 0, &status); in TestRegexCAPI()
553 TEST_ASSERT(uregex_start(re, 0, &status) == 3); in TestRegexCAPI()
554 TEST_ASSERT(uregex_end(re, 0, &status) == 5); in TestRegexCAPI()
555 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
557 result = uregex_find(re, 9, &status); in TestRegexCAPI()
559 TEST_ASSERT(uregex_start(re, 0, &status) == 11); in TestRegexCAPI()
560 TEST_ASSERT(uregex_end(re, 0, &status) == 13); in TestRegexCAPI()
561 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
563 result = uregex_find(re, 14, &status); in TestRegexCAPI()
565 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
567 status = U_ZERO_ERROR; in TestRegexCAPI()
568 uregex_reset(re, 0, &status); in TestRegexCAPI()
570 result = uregex_findNext(re, &status); in TestRegexCAPI()
572 TEST_ASSERT(uregex_start(re, 0, &status) == 3); in TestRegexCAPI()
573 TEST_ASSERT(uregex_end(re, 0, &status) == 5); in TestRegexCAPI()
574 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
576 result = uregex_findNext(re, &status); in TestRegexCAPI()
578 TEST_ASSERT(uregex_start(re, 0, &status) == 6); in TestRegexCAPI()
579 TEST_ASSERT(uregex_end(re, 0, &status) == 8); in TestRegexCAPI()
580 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
582 status = U_ZERO_ERROR; in TestRegexCAPI()
583 uregex_reset(re, 12, &status); in TestRegexCAPI()
585 result = uregex_findNext(re, &status); in TestRegexCAPI()
587 TEST_ASSERT(uregex_start(re, 0, &status) == 13); in TestRegexCAPI()
588 TEST_ASSERT(uregex_end(re, 0, &status) == 15); in TestRegexCAPI()
589 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
591 result = uregex_findNext(re, &status); in TestRegexCAPI()
593 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
604 status = U_ZERO_ERROR; in TestRegexCAPI()
605 re = uregex_openC("abc", 0, NULL, &status); in TestRegexCAPI()
606 result = uregex_groupCount(re, &status); in TestRegexCAPI()
607 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
611 status = U_ZERO_ERROR; in TestRegexCAPI()
612 re = uregex_openC("abc(def)(ghi(j))", 0, NULL, &status); in TestRegexCAPI()
613 result = uregex_groupCount(re, &status); in TestRegexCAPI()
614 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
631 status = U_ZERO_ERROR; in TestRegexCAPI()
632 re = uregex_openC("abc(.*?)def", 0, NULL, &status); in TestRegexCAPI()
633 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
636 uregex_setText(re, text1, -1, &status); in TestRegexCAPI()
637 result = uregex_find(re, 0, &status); in TestRegexCAPI()
641 status = U_ZERO_ERROR; in TestRegexCAPI()
642 resultSz = uregex_group(re, 0, buf, UPRV_LENGTHOF(buf), &status); in TestRegexCAPI()
643 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
648 status = U_ZERO_ERROR; in TestRegexCAPI()
649 resultSz = uregex_group(re, 1, buf, UPRV_LENGTHOF(buf), &status); in TestRegexCAPI()
650 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
655 status = U_ZERO_ERROR; in TestRegexCAPI()
656 uregex_group(re, 2, buf, UPRV_LENGTHOF(buf), &status); in TestRegexCAPI()
657 TEST_ASSERT(status == U_INDEX_OUTOFBOUNDS_ERROR); in TestRegexCAPI()
660 status = U_ZERO_ERROR; in TestRegexCAPI()
661 resultSz = uregex_group(re, 0, NULL, 0, &status); in TestRegexCAPI()
662 TEST_ASSERT(status == U_BUFFER_OVERFLOW_ERROR); in TestRegexCAPI()
666 status = U_ZERO_ERROR; in TestRegexCAPI()
668 resultSz = uregex_group(re, 0, buf, 5, &status); in TestRegexCAPI()
669 TEST_ASSERT(status == U_BUFFER_OVERFLOW_ERROR); in TestRegexCAPI()
675 status = U_ZERO_ERROR; in TestRegexCAPI()
676 resultSz = uregex_group(re, 0, buf, (int32_t)strlen("abc interior def"), &status); in TestRegexCAPI()
677 TEST_ASSERT(status == U_STRING_NOT_TERMINATED_WARNING); in TestRegexCAPI()
694 TEST_ASSERT(uregex_regionStart(re, &status) == 0); in TestRegexCAPI()
695 TEST_ASSERT(uregex_regionEnd(re, &status) == 16); in TestRegexCAPI()
696 uregex_setRegion(re, 3, 6, &status); in TestRegexCAPI()
697 TEST_ASSERT(uregex_regionStart(re, &status) == 3); in TestRegexCAPI()
698 TEST_ASSERT(uregex_regionEnd(re, &status) == 6); in TestRegexCAPI()
699 TEST_ASSERT(uregex_findNext(re, &status)); in TestRegexCAPI()
700 TEST_ASSERT(uregex_group(re, 0, resultString, UPRV_LENGTHOF(resultString), &status) == 3) in TestRegexCAPI()
706 uregex_setRegion(re, 4, 6, &status); in TestRegexCAPI()
707 TEST_ASSERT(uregex_find(re, -1, &status) == TRUE); in TestRegexCAPI()
708 TEST_ASSERT(uregex_start(re, 0, &status) == 4); in TestRegexCAPI()
709 TEST_ASSERT(uregex_end(re, 0, &status) == 6); in TestRegexCAPI()
714 uregex_setRegion(re, 4, 6, &status); in TestRegexCAPI()
715 TEST_ASSERT(uregex_find(re, 0, &status) == TRUE); in TestRegexCAPI()
716 TEST_ASSERT(uregex_start(re, 0, &status) == 0); in TestRegexCAPI()
717 TEST_ASSERT(uregex_end(re, 0, &status) == 16); in TestRegexCAPI()
722 uregex_setRegion(re, 4, 6, &status); in TestRegexCAPI()
723 TEST_ASSERT(uregex_findNext(re,&status) == TRUE); in TestRegexCAPI()
724 TEST_ASSERT(uregex_start(re, 0, &status) == 4); in TestRegexCAPI()
725 TEST_ASSERT(uregex_findNext(re, &status) == TRUE); in TestRegexCAPI()
726 TEST_ASSERT(uregex_start(re, 0, &status) == 5); in TestRegexCAPI()
727 TEST_ASSERT(uregex_findNext(re, &status) == FALSE); in TestRegexCAPI()
733 uregex_setRegion(re, 4, 6, &status); in TestRegexCAPI()
734 TEST_ASSERT(uregex_matches(re, -1, &status) == TRUE); in TestRegexCAPI()
735 TEST_ASSERT(uregex_start(re, 0, &status) == 4); in TestRegexCAPI()
736 TEST_ASSERT(uregex_end(re, 0, &status) == 6); in TestRegexCAPI()
741 uregex_setRegion(re, 4, 6, &status); in TestRegexCAPI()
742 TEST_ASSERT(uregex_matches(re, 0, &status) == TRUE); in TestRegexCAPI()
743 TEST_ASSERT(uregex_start(re, 0, &status) == 0); in TestRegexCAPI()
744 TEST_ASSERT(uregex_end(re, 0, &status) == 16); in TestRegexCAPI()
750 uregex_setRegion(re, 4, 6, &status); in TestRegexCAPI()
751 TEST_ASSERT(uregex_lookingAt(re, -1, &status) == TRUE); in TestRegexCAPI()
752 TEST_ASSERT(uregex_start(re, 0, &status) == 4); in TestRegexCAPI()
753 TEST_ASSERT(uregex_end(re, 0, &status) == 4); in TestRegexCAPI()
758 uregex_setRegion(re, 4, 6, &status); in TestRegexCAPI()
759 TEST_ASSERT(uregex_lookingAt(re, 0, &status) == TRUE); in TestRegexCAPI()
760 TEST_ASSERT(uregex_start(re, 0, &status) == 0); in TestRegexCAPI()
761 TEST_ASSERT(uregex_end(re, 0, &status) == 0); in TestRegexCAPI()
766 TEST_ASSERT(uregex_find(re, 0, &status) == TRUE); in TestRegexCAPI()
767 TEST_ASSERT(uregex_hitEnd(re, &status) == FALSE); in TestRegexCAPI()
771 TEST_ASSERT(uregex_find(re, 0, &status) == TRUE); in TestRegexCAPI()
772 TEST_ASSERT(uregex_hitEnd(re, &status) == TRUE); in TestRegexCAPI()
777 TEST_ASSERT(uregex_find(re, 0, &status) == TRUE); in TestRegexCAPI()
778 TEST_ASSERT(uregex_requireEnd(re, &status) == FALSE); in TestRegexCAPI()
782 TEST_ASSERT(uregex_find(re, 0, &status) == TRUE); in TestRegexCAPI()
783 TEST_ASSERT(uregex_requireEnd(re, &status) == TRUE); in TestRegexCAPI()
788 TEST_ASSERT(uregex_hasAnchoringBounds(re, &status) == TRUE); in TestRegexCAPI()
789 uregex_useAnchoringBounds(re, FALSE, &status); in TestRegexCAPI()
790 TEST_ASSERT(uregex_hasAnchoringBounds(re, &status) == FALSE); in TestRegexCAPI()
792 TEST_ASSERT(uregex_find(re, -1, &status) == FALSE); in TestRegexCAPI()
793 uregex_useAnchoringBounds(re, TRUE, &status); in TestRegexCAPI()
794 uregex_setRegion(re, 0, 3, &status); in TestRegexCAPI()
795 TEST_ASSERT(uregex_find(re, -1, &status) == TRUE); in TestRegexCAPI()
796 TEST_ASSERT(uregex_end(re, 0, &status) == 3); in TestRegexCAPI()
801 TEST_ASSERT(uregex_hasTransparentBounds(re, &status) == FALSE); in TestRegexCAPI()
802 uregex_useTransparentBounds(re, TRUE, &status); in TestRegexCAPI()
803 TEST_ASSERT(uregex_hasTransparentBounds(re, &status) == TRUE); in TestRegexCAPI()
805 uregex_useTransparentBounds(re, FALSE, &status); in TestRegexCAPI()
806 TEST_ASSERT(uregex_find(re, -1, &status) == TRUE); /* No Region */ in TestRegexCAPI()
807 uregex_setRegion(re, 0, 3, &status); in TestRegexCAPI()
808 TEST_ASSERT(uregex_find(re, -1, &status) == FALSE); /* with region, opaque bounds */ in TestRegexCAPI()
809 uregex_useTransparentBounds(re, TRUE, &status); in TestRegexCAPI()
810 TEST_ASSERT(uregex_find(re, -1, &status) == TRUE); /* with region, transparent bounds */ in TestRegexCAPI()
811 TEST_ASSERT(uregex_end(re, 0, &status) == 3); in TestRegexCAPI()
828 status = U_ZERO_ERROR; in TestRegexCAPI()
829 re = uregex_openC("x(.*?)x", 0, NULL, &status); in TestRegexCAPI()
830 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
833 uregex_setText(re, text1, -1, &status); in TestRegexCAPI()
834 resultSz = uregex_replaceFirst(re, replText, -1, buf, UPRV_LENGTHOF(buf), &status); in TestRegexCAPI()
835 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
840 status = U_ZERO_ERROR; in TestRegexCAPI()
841 uregex_setText(re, text2, -1, &status); in TestRegexCAPI()
842 resultSz = uregex_replaceFirst(re, replText, -1, buf, UPRV_LENGTHOF(buf), &status); in TestRegexCAPI()
843 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
848 status = U_ZERO_ERROR; in TestRegexCAPI()
849 uregex_setText(re, text1, -1, &status); in TestRegexCAPI()
851 … resultSz = uregex_replaceFirst(re, replText, -1, buf, strlen("Replace <aa> x1x x...x."), &status); in TestRegexCAPI()
852 TEST_ASSERT(status == U_STRING_NOT_TERMINATED_WARNING); in TestRegexCAPI()
860 status = U_ZERO_ERROR; in TestRegexCAPI()
862 … resultSz = uregex_replaceFirst(re, replText, -1, buf, strlen("Replace <aa> x1x x...x."), &status); in TestRegexCAPI()
863 TEST_ASSERT(status == U_STRING_NOT_TERMINATED_WARNING); in TestRegexCAPI()
869 status = U_ZERO_ERROR; in TestRegexCAPI()
870 resultSz = uregex_replaceFirst(re, replText, -1, NULL, 0, &status); in TestRegexCAPI()
871 TEST_ASSERT(status == U_BUFFER_OVERFLOW_ERROR); in TestRegexCAPI()
875 status = U_ZERO_ERROR; in TestRegexCAPI()
877 …esultSz = uregex_replaceFirst(re, replText, -1, buf, strlen("Replace <aa> x1x x...x.")-1, &status); in TestRegexCAPI()
878 TEST_ASSERT(status == U_BUFFER_OVERFLOW_ERROR); in TestRegexCAPI()
911 status = U_ZERO_ERROR; in TestRegexCAPI()
912 re = uregex_openC(pattern, 0, NULL, &status); in TestRegexCAPI()
913 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
916 uregex_setText(re, text1, -1, &status); in TestRegexCAPI()
917 resultSize = uregex_replaceAll(re, replText, -1, buf, UPRV_LENGTHOF(buf), &status); in TestRegexCAPI()
918 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
923 status = U_ZERO_ERROR; in TestRegexCAPI()
924 uregex_setText(re, text2, -1, &status); in TestRegexCAPI()
925 resultSize = uregex_replaceAll(re, replText, -1, buf, UPRV_LENGTHOF(buf), &status); in TestRegexCAPI()
926 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
931 status = U_ZERO_ERROR; in TestRegexCAPI()
932 uregex_setText(re, text1, -1, &status); in TestRegexCAPI()
934 resultSize = uregex_replaceAll(re, replText, -1, buf, expectedResultSize, &status); in TestRegexCAPI()
935 TEST_ASSERT(status == U_STRING_NOT_TERMINATED_WARNING); in TestRegexCAPI()
943 status = U_ZERO_ERROR; in TestRegexCAPI()
945 … resultSize = uregex_replaceAll(re, replText, -1, buf, strlen("Replace xaax x1x x...x."), &status); in TestRegexCAPI()
946 TEST_ASSERT(status == U_STRING_NOT_TERMINATED_WARNING); in TestRegexCAPI()
952 status = U_ZERO_ERROR; in TestRegexCAPI()
953 resultSize = uregex_replaceAll(re, replText, -1, NULL, 0, &status); in TestRegexCAPI()
954 TEST_ASSERT(status == U_BUFFER_OVERFLOW_ERROR); in TestRegexCAPI()
961 status = U_ZERO_ERROR; in TestRegexCAPI()
963 resultSize = uregex_replaceAll(re, replText, -1, buf, i, &status); in TestRegexCAPI()
964 TEST_ASSERT(status == U_BUFFER_OVERFLOW_ERROR); in TestRegexCAPI()
978 status = U_ZERO_ERROR; in TestRegexCAPI()
980 resultSize = uregex_replaceAll(re, replText2, -1, buf, i, &status); in TestRegexCAPI()
981 TEST_ASSERT(status == U_BUFFER_OVERFLOW_ERROR); in TestRegexCAPI()
1005 status = U_ZERO_ERROR; in TestRegexCAPI()
1006 re = uregex_openC(".*", 0, 0, &status); in TestRegexCAPI()
1007 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
1011 uregex_setText(re, text, -1, &status); in TestRegexCAPI()
1014 uregex_find(re, 0, &status); in TestRegexCAPI()
1015 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
1018 uregex_appendReplacement(re, repl, -1, &bufPtr, &bufCap, &status); in TestRegexCAPI()
1019 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
1023 uregex_find(re, 0, &status); in TestRegexCAPI()
1024 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
1028 uregex_appendReplacement(re, repl, -1, &bufPtr, &bufCap, &status); in TestRegexCAPI()
1029 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
1033 status = U_ZERO_ERROR; in TestRegexCAPI()
1034 uregex_find(re, 0, &status); in TestRegexCAPI()
1035 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
1037 status = U_BUFFER_OVERFLOW_ERROR; in TestRegexCAPI()
1038 uregex_appendReplacement(re, repl, -1, &bufPtr, NULL, &status); in TestRegexCAPI()
1039 TEST_ASSERT(status == U_BUFFER_OVERFLOW_ERROR); in TestRegexCAPI()
1065 status = U_ZERO_ERROR; in TestRegexCAPI()
1066 re = uregex_openC(":", 0, NULL, &status); in TestRegexCAPI()
1071 uregex_setText(re, textToSplit, -1, &status); in TestRegexCAPI()
1072 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
1075 if (U_SUCCESS(status)) { in TestRegexCAPI()
1078 uregex_split(re, buf, UPRV_LENGTHOF(buf), &requiredCapacity, fields, 10, &status); in TestRegexCAPI()
1079 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
1082 if(U_SUCCESS(status)) { in TestRegexCAPI()
1101 status = U_ZERO_ERROR; in TestRegexCAPI()
1102 re = uregex_openC(":", 0, NULL, &status); in TestRegexCAPI()
1103 uregex_setText(re, textToSplit, -1, &status); in TestRegexCAPI()
1104 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
1107 if(U_SUCCESS(status)) { in TestRegexCAPI()
1110 uregex_split(re, buf, UPRV_LENGTHOF(buf), &requiredCapacity, fields, 2, &status); in TestRegexCAPI()
1111 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
1114 if(U_SUCCESS(status)) { in TestRegexCAPI()
1133 status = U_ZERO_ERROR; in TestRegexCAPI()
1135 uregex_split(re, buf, sz, &requiredCapacity, fields, 10, &status); in TestRegexCAPI()
1137 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
1142 TEST_ASSERT(status == U_BUFFER_OVERFLOW_ERROR); in TestRegexCAPI()
1170 status = U_ZERO_ERROR; in TestRegexCAPI()
1171 re = uregex_openC("<(.*?)>", 0, NULL, &status); in TestRegexCAPI()
1173 uregex_setText(re, textToSplit, -1, &status); in TestRegexCAPI()
1174 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
1177 if(U_SUCCESS(status)) { in TestRegexCAPI()
1180 uregex_split(re, buf, UPRV_LENGTHOF(buf), &requiredCapacity, fields, 10, &status); in TestRegexCAPI()
1181 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
1184 if(U_SUCCESS(status)) { in TestRegexCAPI()
1198 status = U_ZERO_ERROR; in TestRegexCAPI()
1201 uregex_split(re, buf, UPRV_LENGTHOF(buf), &requiredCapacity, fields, 2, &status); in TestRegexCAPI()
1202 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
1205 if(U_SUCCESS(status)) { in TestRegexCAPI()
1216 status = U_ZERO_ERROR; in TestRegexCAPI()
1219 uregex_split(re, buf, UPRV_LENGTHOF(buf), &requiredCapacity, fields, 3, &status); in TestRegexCAPI()
1220 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
1223 if(U_SUCCESS(status)) { in TestRegexCAPI()
1235 status = U_ZERO_ERROR; in TestRegexCAPI()
1238 uregex_split(re, buf, UPRV_LENGTHOF(buf), &requiredCapacity, fields, 5, &status); in TestRegexCAPI()
1239 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
1242 if(U_SUCCESS(status)) { in TestRegexCAPI()
1256 status = U_ZERO_ERROR; in TestRegexCAPI()
1258 uregex_setText(re, textToSplit, sz, &status); in TestRegexCAPI()
1259 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
1262 if(U_SUCCESS(status)) { in TestRegexCAPI()
1265 uregex_split(re, buf, UPRV_LENGTHOF(buf), &requiredCapacity, fields, 9, &status); in TestRegexCAPI()
1266 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
1269 if(U_SUCCESS(status)) { in TestRegexCAPI()
1291 TEST_ASSERT(uregex_getTimeLimit(re, &status) == 0); in TestRegexCAPI()
1292 uregex_setTimeLimit(re, 1000, &status); in TestRegexCAPI()
1293 TEST_ASSERT(uregex_getTimeLimit(re, &status) == 1000); in TestRegexCAPI()
1294 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
1295 uregex_setTimeLimit(re, -1, &status); in TestRegexCAPI()
1296 TEST_ASSERT(status == U_ILLEGAL_ARGUMENT_ERROR); in TestRegexCAPI()
1297 status = U_ZERO_ERROR; in TestRegexCAPI()
1298 TEST_ASSERT(uregex_getTimeLimit(re, &status) == 1000); in TestRegexCAPI()
1305 TEST_ASSERT(uregex_getStackLimit(re, &status) == 8000000); in TestRegexCAPI()
1306 uregex_setStackLimit(re, 40000, &status); in TestRegexCAPI()
1307 TEST_ASSERT(uregex_getStackLimit(re, &status) == 40000); in TestRegexCAPI()
1308 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
1309 uregex_setStackLimit(re, -1, &status); in TestRegexCAPI()
1310 TEST_ASSERT(status == U_ILLEGAL_ARGUMENT_ERROR); in TestRegexCAPI()
1311 status = U_ZERO_ERROR; in TestRegexCAPI()
1312 TEST_ASSERT(uregex_getStackLimit(re, &status) == 40000); in TestRegexCAPI()
1329 uregex_getMatchCallback(re, &returnedFn, &pContext, &status); in TestRegexCAPI()
1330 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
1336 uregex_setMatchCallback(re, &TestCallbackFn, &cbInfo, &status); in TestRegexCAPI()
1337 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
1339 TEST_ASSERT(uregex_matches(re, -1, &status) == FALSE); in TestRegexCAPI()
1340 TEST_ASSERT_SUCCESS(status); in TestRegexCAPI()
1344 uregex_getMatchCallback(re, &returnedFn, &pContext, &status); in TestRegexCAPI()
1406 UErrorCode status = U_ZERO_ERROR; in TestUTextAPI() local
1413 utext_openUTF8(&patternText, patternTextUTF8, -1, &status); in TestUTextAPI()
1414 re = uregex_openUText(&patternText, 0, 0, &status); in TestUTextAPI()
1415 if (U_FAILURE(status)) { in TestUTextAPI()
1416 …ssion, %s:%d, error is \"%s\" (Are you missing data?)\n", __FILE__, __LINE__, u_errorName(status)); in TestUTextAPI()
1423 status = U_ZERO_ERROR; in TestUTextAPI()
1426 0, &status); in TestUTextAPI()
1427 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1431 status = U_ZERO_ERROR; in TestUTextAPI()
1432 re = uregex_openUText(&patternText, 0x40000000, 0, &status); in TestUTextAPI()
1433 TEST_ASSERT(status == U_REGEX_INVALID_FLAG); in TestUTextAPI()
1437 status = U_ZERO_ERROR; in TestUTextAPI()
1439 …_CASE_INSENSITIVE | UREGEX_COMMENTS | UREGEX_DOTALL | UREGEX_MULTILINE | UREGEX_UWORD, 0, &status); in TestUTextAPI()
1440 TEST_ASSERT(status == U_ILLEGAL_ARGUMENT_ERROR && re == NULL); in TestUTextAPI()
1454 status = U_ZERO_ERROR; in TestUTextAPI()
1455 re = uregex_openUText(&patternText, 0, 0, &status); in TestUTextAPI()
1456 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1457 clone1 = uregex_clone(re, &status); in TestUTextAPI()
1458 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1461 status = U_ZERO_ERROR; in TestUTextAPI()
1462 clone2 = uregex_clone(re, &status); in TestUTextAPI()
1463 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1467 status = U_ZERO_ERROR; in TestUTextAPI()
1468 clone3 = uregex_clone(clone2, &status); in TestUTextAPI()
1469 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1475 status = U_ZERO_ERROR; in TestUTextAPI()
1476 uregex_setText(clone1, testString1, -1, &status); in TestUTextAPI()
1477 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1478 result = uregex_lookingAt(clone1, 0, &status); in TestUTextAPI()
1479 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1482 status = U_ZERO_ERROR; in TestUTextAPI()
1483 uregex_setText(clone2, testString2, -1, &status); in TestUTextAPI()
1484 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1485 result = uregex_lookingAt(clone2, 0, &status); in TestUTextAPI()
1486 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1488 result = uregex_find(clone2, 0, &status); in TestUTextAPI()
1489 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1508 status = U_ZERO_ERROR; in TestUTextAPI()
1510 utext_openUTF8(&patternText, str_hello, -1, &status); in TestUTextAPI()
1511 re = uregex_open(pat, -1, 0, NULL, &status); in TestUTextAPI()
1512 resultPat = uregex_pattern(re, &resultLen, &status); in TestUTextAPI()
1513 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1516 if (U_SUCCESS(status)) { in TestUTextAPI()
1521 resultText = uregex_patternUText(re, &status); in TestUTextAPI()
1522 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1527 status = U_ZERO_ERROR; in TestUTextAPI()
1528 re = uregex_open(pat, 3, 0, NULL, &status); in TestUTextAPI()
1529 resultPat = uregex_pattern(re, &resultLen, &status); in TestUTextAPI()
1530 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1533 if (U_SUCCESS(status)) { in TestUTextAPI()
1539 resultText = uregex_patternUText(re, &status); in TestUTextAPI()
1540 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1556 status = U_ZERO_ERROR; in TestUTextAPI()
1557 utext_openUTF8(&text1, str_abcccd, -1, &status); in TestUTextAPI()
1558 utext_openUTF8(&text2, str_abcccxd, -1, &status); in TestUTextAPI()
1560 utext_openUTF8(&patternText, str_abcd, -1, &status); in TestUTextAPI()
1561 re = uregex_openUText(&patternText, 0, NULL, &status); in TestUTextAPI()
1562 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1565 status = U_ZERO_ERROR; in TestUTextAPI()
1566 uregex_lookingAt(re, 0, &status); in TestUTextAPI()
1567 TEST_ASSERT( status== U_REGEX_INVALID_STATE); in TestUTextAPI()
1569 status = U_ZERO_ERROR; in TestUTextAPI()
1570 uregex_setUText(re, &text1, &status); in TestUTextAPI()
1571 result = uregex_lookingAt(re, 0, &status); in TestUTextAPI()
1573 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1575 status = U_ZERO_ERROR; in TestUTextAPI()
1576 uregex_setUText(re, &text2, &status); in TestUTextAPI()
1577 result = uregex_lookingAt(re, 0, &status); in TestUTextAPI()
1579 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1581 status = U_ZERO_ERROR; in TestUTextAPI()
1582 uregex_setUText(re, &text1, &status); in TestUTextAPI()
1583 result = uregex_lookingAt(re, 0, &status); in TestUTextAPI()
1585 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1608 status = U_ZERO_ERROR; in TestUTextAPI()
1609 utext_openUTF8(&text1, str_abcccd, -1, &status); in TestUTextAPI()
1611 utext_openUChars(&text2, text2Chars, -1, &status); in TestUTextAPI()
1613 utext_openUTF8(&patternText, str_abcd, -1, &status); in TestUTextAPI()
1614 re = uregex_openUText(&patternText, 0, NULL, &status); in TestUTextAPI()
1617 uregex_setUText(re, &text1, &status); in TestUTextAPI()
1618 resultText = uregex_getUText(re, NULL, &status); in TestUTextAPI()
1619 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1626 result = uregex_getText(re, &textLength, &status); /* flattens UText into buffer */ in TestUTextAPI()
1629 resultText = uregex_getUText(re, NULL, &status); in TestUTextAPI()
1630 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1638 uregex_setText(re, text2Chars, 7, &status); in TestUTextAPI()
1639 resultText = uregex_getUText(re, NULL, &status); in TestUTextAPI()
1640 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1645 result = uregex_getText(re, &textLength, &status); in TestUTextAPI()
1663 status = U_ZERO_ERROR; in TestUTextAPI()
1664 utext_openUTF8(&text1, str_abcccde, -1, &status); in TestUTextAPI()
1665 utext_openUTF8(&patternText, str_abcd, -1, &status); in TestUTextAPI()
1666 re = uregex_openUText(&patternText, 0, NULL, &status); in TestUTextAPI()
1668 uregex_setUText(re, &text1, &status); in TestUTextAPI()
1669 result = uregex_matches(re, 0, &status); in TestUTextAPI()
1671 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1674 status = U_ZERO_ERROR; in TestUTextAPI()
1675 re = uregex_openC(".?", 0, NULL, &status); in TestUTextAPI()
1676 uregex_setUText(re, &text1, &status); in TestUTextAPI()
1677 result = uregex_matches(re, 7, &status); in TestUTextAPI()
1679 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1681 status = U_ZERO_ERROR; in TestUTextAPI()
1682 utext_openUTF8(&nullText, "", -1, &status); in TestUTextAPI()
1683 uregex_setUText(re, &nullText, &status); in TestUTextAPI()
1684 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1685 result = uregex_matches(re, 0, &status); in TestUTextAPI()
1687 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1707 status = U_ZERO_ERROR; in TestUTextAPI()
1708 re = uregex_openC("rx", 0, NULL, &status); in TestUTextAPI()
1710 uregex_setText(re, text1, -1, &status); in TestUTextAPI()
1711 result = uregex_find(re, 0, &status); in TestUTextAPI()
1713 TEST_ASSERT(uregex_start(re, 0, &status) == 3); in TestUTextAPI()
1714 TEST_ASSERT(uregex_end(re, 0, &status) == 5); in TestUTextAPI()
1715 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1717 result = uregex_find(re, 9, &status); in TestUTextAPI()
1719 TEST_ASSERT(uregex_start(re, 0, &status) == 11); in TestUTextAPI()
1720 TEST_ASSERT(uregex_end(re, 0, &status) == 13); in TestUTextAPI()
1721 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1723 result = uregex_find(re, 14, &status); in TestUTextAPI()
1725 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1727 status = U_ZERO_ERROR; in TestUTextAPI()
1728 uregex_reset(re, 0, &status); in TestUTextAPI()
1730 result = uregex_findNext(re, &status); in TestUTextAPI()
1732 TEST_ASSERT(uregex_start(re, 0, &status) == 3); in TestUTextAPI()
1733 TEST_ASSERT(uregex_end(re, 0, &status) == 5); in TestUTextAPI()
1734 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1736 result = uregex_findNext(re, &status); in TestUTextAPI()
1738 TEST_ASSERT(uregex_start(re, 0, &status) == 6); in TestUTextAPI()
1739 TEST_ASSERT(uregex_end(re, 0, &status) == 8); in TestUTextAPI()
1740 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1742 status = U_ZERO_ERROR; in TestUTextAPI()
1743 uregex_reset(re, 12, &status); in TestUTextAPI()
1745 result = uregex_findNext(re, &status); in TestUTextAPI()
1747 TEST_ASSERT(uregex_start(re, 0, &status) == 13); in TestUTextAPI()
1748 TEST_ASSERT(uregex_end(re, 0, &status) == 15); in TestUTextAPI()
1749 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1751 result = uregex_findNext(re, &status); in TestUTextAPI()
1753 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1770 status = U_ZERO_ERROR; in TestUTextAPI()
1771 re = uregex_openC("abc(.*?)def", 0, NULL, &status); in TestUTextAPI()
1772 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1774 uregex_setText(re, text1, -1, &status); in TestUTextAPI()
1775 result = uregex_find(re, 0, &status); in TestUTextAPI()
1779 status = U_ZERO_ERROR; in TestUTextAPI()
1780 actual = uregex_groupUText(re, 0, NULL, &groupLen, &status); in TestUTextAPI()
1781 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1785 …ext_extract(actual, 6 /*start index */, 6+16 /*limit index*/, groupBuf, sizeof(groupBuf), &status); in TestUTextAPI()
1791 status = U_ZERO_ERROR; in TestUTextAPI()
1793 actual = uregex_groupUText(re, 1, NULL, &groupLen, &status); in TestUTextAPI()
1794 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1798 …text_extract(actual, 9 /*start index*/, 9+10 /*limit index*/, groupBuf, sizeof(groupBuf), &status); in TestUTextAPI()
1804 status = U_ZERO_ERROR; in TestUTextAPI()
1805 actual = uregex_groupUText(re, 2, NULL, &groupLen, &status); in TestUTextAPI()
1806 TEST_ASSERT(status == U_INDEX_OUTOFBOUNDS_ERROR); in TestUTextAPI()
1826 status = U_ZERO_ERROR; in TestUTextAPI()
1829 utext_openUTF8(&replText, str_1x, -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_replaceFirstUText(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_replaceFirstUText(re, &replText, NULL, &status); in TestUTextAPI()
1844 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1849 uregex_setText(re, text1, -1, &status); in TestUTextAPI()
1850 utext_openUTF8(&replText, str_u00411U00000042a, -1, &status); in TestUTextAPI()
1851 result = uregex_replaceFirstUText(re, &replText, NULL, &status); in TestUTextAPI()
1852 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1872 status = U_ZERO_ERROR; in TestUTextAPI()
1875 utext_openUTF8(&replText, str_1, -1, &status); in TestUTextAPI()
1877 re = uregex_openC("x(.*?)x", 0, NULL, &status); in TestUTextAPI()
1878 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1881 uregex_setText(re, text1, -1, &status); in TestUTextAPI()
1882 result = uregex_replaceAllUText(re, &replText, NULL, &status); in TestUTextAPI()
1883 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1888 uregex_setText(re, text2, -1, &status); in TestUTextAPI()
1889 result = uregex_replaceAllUText(re, &replText, NULL, &status); in TestUTextAPI()
1890 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1909 status = U_ZERO_ERROR; in TestUTextAPI()
1910 re = uregex_openC(".*", 0, 0, &status); in TestUTextAPI()
1911 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1915 uregex_setText(re, text, -1, &status); in TestUTextAPI()
1918 uregex_find(re, 0, &status); in TestUTextAPI()
1919 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1922 uregex_appendReplacement(re, repl, -1, &bufPtr, &bufCap, &status); in TestUTextAPI()
1923 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1927 uregex_find(re, 0, &status); in TestUTextAPI()
1928 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1932 uregex_appendReplacement(re, repl, -1, &bufPtr, &bufCap, &status); in TestUTextAPI()
1933 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1957 status = U_ZERO_ERROR; in TestUTextAPI()
1958 re = uregex_openC(":", 0, NULL, &status); in TestUTextAPI()
1963 uregex_setText(re, textToSplit, -1, &status); in TestUTextAPI()
1964 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1967 if (U_SUCCESS(status)) { in TestUTextAPI()
1969 numFields = uregex_splitUText(re, fields, 10, &status); in TestUTextAPI()
1970 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1973 if(U_SUCCESS(status)) { in TestUTextAPI()
1992 status = U_ZERO_ERROR; in TestUTextAPI()
1993 re = uregex_openC(":", 0, NULL, &status); in TestUTextAPI()
1994 uregex_setText(re, textToSplit, -1, &status); in TestUTextAPI()
1995 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
1998 if(U_SUCCESS(status)) { in TestUTextAPI()
2002 numFields = uregex_splitUText(re, fields, 2, &status); in TestUTextAPI()
2003 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
2006 if(U_SUCCESS(status)) { in TestUTextAPI()
2032 status = U_ZERO_ERROR; in TestUTextAPI()
2033 re = uregex_openC("<(.*?)>", 0, NULL, &status); in TestUTextAPI()
2035 uregex_setText(re, textToSplit, -1, &status); in TestUTextAPI()
2036 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
2039 if(U_SUCCESS(status)) { in TestUTextAPI()
2041 numFields = uregex_splitUText(re, fields, 10, &status); in TestUTextAPI()
2042 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
2045 if(U_SUCCESS(status)) { in TestUTextAPI()
2066 status = U_ZERO_ERROR; in TestUTextAPI()
2070 numFields = uregex_splitUText(re, fields, 2, &status); in TestUTextAPI()
2071 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
2074 if(U_SUCCESS(status)) { in TestUTextAPI()
2088 status = U_ZERO_ERROR; in TestUTextAPI()
2093 numFields = uregex_splitUText(re, fields, 3, &status); in TestUTextAPI()
2094 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
2097 if(U_SUCCESS(status)) { in TestUTextAPI()
2112 status = U_ZERO_ERROR; in TestUTextAPI()
2119 numFields = uregex_splitUText(re, fields, 5, &status); in TestUTextAPI()
2120 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
2123 if(U_SUCCESS(status)) { in TestUTextAPI()
2143 status = U_ZERO_ERROR; in TestUTextAPI()
2144 uregex_setText(re, textToSplit, strlen("first <tag-a> second<tag-b>"), &status); in TestUTextAPI()
2145 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
2148 if(U_SUCCESS(status)) { in TestUTextAPI()
2151 numFields = uregex_splitUText(re, fields, 9, &status); in TestUTextAPI()
2152 TEST_ASSERT_SUCCESS(status); in TestUTextAPI()
2155 if(U_SUCCESS(status)) { in TestUTextAPI()
2193 UErrorCode status = U_ZERO_ERROR; in TestRefreshInput() local
2198 re = uregex_openC("[ABC]", 0, 0, &status); in TestRefreshInput()
2199 TEST_ASSERT_SUCCESS(status); in TestRefreshInput()
2201 utext_openUChars(&ut1, testStr, -1, &status); in TestRefreshInput()
2202 TEST_ASSERT_SUCCESS(status); in TestRefreshInput()
2203 uregex_setUText(re, &ut1, &status); in TestRefreshInput()
2204 TEST_ASSERT_SUCCESS(status); in TestRefreshInput()
2207 TEST_ASSERT(uregex_findNext(re, &status)); in TestRefreshInput()
2208 TEST_ASSERT(uregex_start(re, 0, &status) == 0); in TestRefreshInput()
2213 utext_openUChars(&ut2, movedStr, -1, &status); in TestRefreshInput()
2214 TEST_ASSERT_SUCCESS(status); in TestRefreshInput()
2215 uregex_refreshUText(re, &ut2, &status); in TestRefreshInput()
2216 TEST_ASSERT_SUCCESS(status); in TestRefreshInput()
2219 TEST_ASSERT(uregex_findNext(re, &status)); in TestRefreshInput()
2220 TEST_ASSERT(uregex_start(re, 0, &status) == 2); in TestRefreshInput()
2221 TEST_ASSERT(uregex_findNext(re, &status)); in TestRefreshInput()
2222 TEST_ASSERT(uregex_start(re, 0, &status) == 4); in TestRefreshInput()
2223 TEST_ASSERT(FALSE == uregex_findNext(re, &status)); in TestRefreshInput()
2234 UErrorCode status = U_ZERO_ERROR; in TestBug8421() local
2237 re = uregex_openC("abc", 0, 0, &status); in TestBug8421()
2238 TEST_ASSERT_SUCCESS(status); in TestBug8421()
2240 limit = uregex_getTimeLimit(re, &status); in TestBug8421()
2241 TEST_ASSERT_SUCCESS(status); in TestBug8421()
2244 uregex_setTimeLimit(re, 100, &status); in TestBug8421()
2245 TEST_ASSERT_SUCCESS(status); in TestBug8421()
2246 limit = uregex_getTimeLimit(re, &status); in TestBug8421()
2247 TEST_ASSERT_SUCCESS(status); in TestBug8421()
2266 UErrorCode status = U_ZERO_ERROR; in TestBug10815() local
2272 re = uregex_openC(".z", 0, 0, &status); in TestBug10815()
2273 TEST_ASSERT_SUCCESS(status); in TestBug10815()
2276 uregex_setText(re, text, -1, &status); in TestBug10815()
2277 TEST_ASSERT_SUCCESS(status); in TestBug10815()
2279 uregex_setFindProgressCallback(re, FindCallback, NULL, &status); in TestBug10815()
2280 TEST_ASSERT_SUCCESS(status); in TestBug10815()
2282 uregex_findNext(re, &status); in TestBug10815()
2283 TEST_ASSERT(status == U_REGEX_STOPPED_BY_CALLER); in TestBug10815()
2289 status = U_ZERO_ERROR; in TestBug10815()
2290 re = uregex_openC("((xxx)*)*y", 0, 0, &status); in TestBug10815()
2291 TEST_ASSERT_SUCCESS(status); in TestBug10815()
2296 uregex_setText(re, text, -1, &status); in TestBug10815()
2297 TEST_ASSERT_SUCCESS(status); in TestBug10815()
2299 uregex_setMatchCallback(re, MatchCallback, NULL, &status); in TestBug10815()
2300 TEST_ASSERT_SUCCESS(status); in TestBug10815()
2302 uregex_findNext(re, &status); in TestBug10815()
2303 TEST_ASSERT(status == U_REGEX_STOPPED_BY_CALLER); in TestBug10815()