Lines Matching refs:TEST_ASSERT
36 #define TEST_ASSERT(expr) {if ((expr)==FALSE) { \
229 TEST_ASSERT(status == U_REGEX_INVALID_FLAG);
235 TEST_ASSERT(status == U_REGEX_UNIMPLEMENTED);
242 TEST_ASSERT(status == U_ILLEGAL_ARGUMENT_ERROR && re == NULL);
248 TEST_ASSERT(status == U_USELESS_COLLATOR_ERROR && re == NULL);
263 TEST_ASSERT(u_strcmp(pat, p) == 0);
264 TEST_ASSERT(len==(int32_t)strlen("abc*"));
289 TEST_ASSERT(clone1 != NULL);
294 TEST_ASSERT(clone2 != NULL);
300 TEST_ASSERT(clone3 != NULL);
310 TEST_ASSERT(result==TRUE);
317 TEST_ASSERT(result==FALSE);
320 TEST_ASSERT(result==TRUE);
342 TEST_ASSERT(resultLen == -1);
343 TEST_ASSERT(u_strcmp(resultPat, pat) == 0);
356 TEST_ASSERT(resultLen == 3);
357 TEST_ASSERT(u_strncmp(resultPat, pat, 3) == 0);
358 TEST_ASSERT(u_strlen(resultPat) == 3);
374 TEST_ASSERT(t == 0);
381 TEST_ASSERT(t == 0);
388 TEST_ASSERT(t == (UREGEX_CASE_INSENSITIVE | UREGEX_DOTALL));
410 TEST_ASSERT( status== U_REGEX_INVALID_STATE);
415 TEST_ASSERT(result == TRUE);
421 TEST_ASSERT(result == FALSE);
427 TEST_ASSERT(result == TRUE);
433 TEST_ASSERT(result == FALSE);
439 TEST_ASSERT(result == TRUE);
463 TEST_ASSERT(result == text1);
464 TEST_ASSERT(textLength == -1);
470 TEST_ASSERT(result == text2);
471 TEST_ASSERT(textLength == 7);
477 TEST_ASSERT(result == text2);
478 TEST_ASSERT(textLength == 4);
499 TEST_ASSERT(result == FALSE);
505 TEST_ASSERT(result == TRUE);
511 TEST_ASSERT(result == FALSE);
520 TEST_ASSERT(result == TRUE);
527 TEST_ASSERT(result == TRUE);
550 TEST_ASSERT(result == TRUE);
551 TEST_ASSERT(uregex_start(re, 0, &status) == 3);
552 TEST_ASSERT(uregex_end(re, 0, &status) == 5);
556 TEST_ASSERT(result == TRUE);
557 TEST_ASSERT(uregex_start(re, 0, &status) == 11);
558 TEST_ASSERT(uregex_end(re, 0, &status) == 13);
562 TEST_ASSERT(result == FALSE);
569 TEST_ASSERT(result == TRUE);
570 TEST_ASSERT(uregex_start(re, 0, &status) == 3);
571 TEST_ASSERT(uregex_end(re, 0, &status) == 5);
575 TEST_ASSERT(result == TRUE);
576 TEST_ASSERT(uregex_start(re, 0, &status) == 6);
577 TEST_ASSERT(uregex_end(re, 0, &status) == 8);
584 TEST_ASSERT(result == TRUE);
585 TEST_ASSERT(uregex_start(re, 0, &status) == 13);
586 TEST_ASSERT(uregex_end(re, 0, &status) == 15);
590 TEST_ASSERT(result == FALSE);
606 TEST_ASSERT(result == 0);
613 TEST_ASSERT(result == 3);
636 TEST_ASSERT(result==TRUE);
643 TEST_ASSERT(resultSz == (int32_t)strlen("abc interior def"));
650 TEST_ASSERT(resultSz == (int32_t)strlen(" interior "));
655 TEST_ASSERT(status == U_INDEX_OUTOFBOUNDS_ERROR);
660 TEST_ASSERT(status == U_BUFFER_OVERFLOW_ERROR);
661 TEST_ASSERT(resultSz == (int32_t)strlen("abc interior def"));
667 TEST_ASSERT(status == U_BUFFER_OVERFLOW_ERROR);
669 TEST_ASSERT(buf[5] == (UChar)0xffff);
670 TEST_ASSERT(resultSz == (int32_t)strlen("abc interior def"));
675 TEST_ASSERT(status == U_STRING_NOT_TERMINATED_WARNING);
677 TEST_ASSERT(resultSz == (int32_t)strlen("abc interior def"));
678 TEST_ASSERT(buf[strlen("abc interior def")] == (UChar)0xffff);
692 TEST_ASSERT(uregex_regionStart(re, &status) == 0);
693 TEST_ASSERT(uregex_regionEnd(re, &status) == 16);
695 TEST_ASSERT(uregex_regionStart(re, &status) == 3);
696 TEST_ASSERT(uregex_regionEnd(re, &status) == 6);
697 TEST_ASSERT(uregex_findNext(re, &status));
698 TEST_ASSERT(uregex_group(re, 0, resultString, UPRV_LENGTHOF(resultString), &status) == 3)
705 TEST_ASSERT(uregex_find(re, -1, &status) == TRUE);
706 TEST_ASSERT(uregex_start(re, 0, &status) == 4);
707 TEST_ASSERT(uregex_end(re, 0, &status) == 6);
713 TEST_ASSERT(uregex_find(re, 0, &status) == TRUE);
714 TEST_ASSERT(uregex_start(re, 0, &status) == 0);
715 TEST_ASSERT(uregex_end(re, 0, &status) == 16);
721 TEST_ASSERT(uregex_findNext(re,&status) == TRUE);
722 TEST_ASSERT(uregex_start(re, 0, &status) == 4);
723 TEST_ASSERT(uregex_findNext(re, &status) == TRUE);
724 TEST_ASSERT(uregex_start(re, 0, &status) == 5);
725 TEST_ASSERT(uregex_findNext(re, &status) == FALSE);
732 TEST_ASSERT(uregex_matches(re, -1, &status) == TRUE);
733 TEST_ASSERT(uregex_start(re, 0, &status) == 4);
734 TEST_ASSERT(uregex_end(re, 0, &status) == 6);
740 TEST_ASSERT(uregex_matches(re, 0, &status) == TRUE);
741 TEST_ASSERT(uregex_start(re, 0, &status) == 0);
742 TEST_ASSERT(uregex_end(re, 0, &status) == 16);
749 TEST_ASSERT(uregex_lookingAt(re, -1, &status) == TRUE);
750 TEST_ASSERT(uregex_start(re, 0, &status) == 4);
751 TEST_ASSERT(uregex_end(re, 0, &status) == 4);
757 TEST_ASSERT(uregex_lookingAt(re, 0, &status) == TRUE);
758 TEST_ASSERT(uregex_start(re, 0, &status) == 0);
759 TEST_ASSERT(uregex_end(re, 0, &status) == 0);
764 TEST_ASSERT(uregex_find(re, 0, &status) == TRUE);
765 TEST_ASSERT(uregex_hitEnd(re, &status) == FALSE);
769 TEST_ASSERT(uregex_find(re, 0, &status) == TRUE);
770 TEST_ASSERT(uregex_hitEnd(re, &status) == TRUE);
775 TEST_ASSERT(uregex_find(re, 0, &status) == TRUE);
776 TEST_ASSERT(uregex_requireEnd(re, &status) == FALSE);
780 TEST_ASSERT(uregex_find(re, 0, &status) == TRUE);
781 TEST_ASSERT(uregex_requireEnd(re, &status) == TRUE);
786 TEST_ASSERT(uregex_hasAnchoringBounds(re, &status) == TRUE);
788 TEST_ASSERT(uregex_hasAnchoringBounds(re, &status) == FALSE);
790 TEST_ASSERT(uregex_find(re, -1, &status) == FALSE);
793 TEST_ASSERT(uregex_find(re, -1, &status) == TRUE);
794 TEST_ASSERT(uregex_end(re, 0, &status) == 3);
799 TEST_ASSERT(uregex_hasTransparentBounds(re, &status) == FALSE);
801 TEST_ASSERT(uregex_hasTransparentBounds(re, &status) == TRUE);
804 TEST_ASSERT(uregex_find(re, -1, &status) == TRUE); /* No Region */
806 TEST_ASSERT(uregex_find(re, -1, &status) == FALSE); /* with region, opaque bounds */
808 TEST_ASSERT(uregex_find(re, -1, &status) == TRUE); /* with region, transparent bounds */
809 TEST_ASSERT(uregex_end(re, 0, &status) == 3);
835 TEST_ASSERT(resultSz == (int32_t)strlen("Replace xaax x1x x...x."));
843 TEST_ASSERT(resultSz == (int32_t)strlen("No match here."));
850 TEST_ASSERT(status == U_STRING_NOT_TERMINATED_WARNING);
852 TEST_ASSERT(resultSz == (int32_t)strlen("Replace xaax x1x x...x."));
853 TEST_ASSERT(buf[resultSz] == (UChar)0xffff);
861 TEST_ASSERT(status == U_STRING_NOT_TERMINATED_WARNING);
863 TEST_ASSERT(resultSz == (int32_t)strlen("Replace xaax x1x x...x."));
864 TEST_ASSERT(buf[resultSz] == (UChar)0xffff);
869 TEST_ASSERT(status == U_BUFFER_OVERFLOW_ERROR);
870 TEST_ASSERT(resultSz == (int32_t)strlen("Replace xaax x1x x...x."));
876 TEST_ASSERT(status == U_BUFFER_OVERFLOW_ERROR);
878 TEST_ASSERT(resultSz == (int32_t)strlen("Replace xaax x1x x...x."));
879 TEST_ASSERT(buf[resultSz] == (UChar)0xffff);
918 TEST_ASSERT(resultSize == expectedResultSize);
926 TEST_ASSERT(resultSize == u_strlen(text2));
933 TEST_ASSERT(status == U_STRING_NOT_TERMINATED_WARNING);
935 TEST_ASSERT(resultSize == expectedResultSize);
936 TEST_ASSERT(buf[resultSize] == (UChar)0xffff);
944 TEST_ASSERT(status == U_STRING_NOT_TERMINATED_WARNING);
946 TEST_ASSERT(resultSize == (int32_t)strlen("Replace <aa> <1> <...>."));
947 TEST_ASSERT(buf[resultSize] == (UChar)0xffff);
952 TEST_ASSERT(status == U_BUFFER_OVERFLOW_ERROR);
953 TEST_ASSERT(resultSize == (int32_t)strlen("Replace <aa> <1> <...>."));
962 TEST_ASSERT(status == U_BUFFER_OVERFLOW_ERROR);
966 TEST_ASSERT(resultSize == expectedResultSize);
967 TEST_ASSERT(buf[i] == (UChar)0xffff);
979 TEST_ASSERT(status == U_BUFFER_OVERFLOW_ERROR);
983 TEST_ASSERT(resultSize == expectedResultSize2);
984 TEST_ASSERT(buf[i] == (UChar)0xffff);
1037 TEST_ASSERT(status == U_BUFFER_OVERFLOW_ERROR);
1081 TEST_ASSERT(numFields == 3);
1085 TEST_ASSERT(fields[3] == NULL);
1091 TEST_ASSERT(spaceNeeded == requiredCapacity);
1113 TEST_ASSERT(numFields == 2);
1116 TEST_ASSERT(!memcmp(&fields[2],&minus1,sizeof(UChar*)));
1122 TEST_ASSERT(spaceNeeded == requiredCapacity);
1140 TEST_ASSERT(status == U_BUFFER_OVERFLOW_ERROR);
1142 TEST_ASSERT(numFields == 3);
1143 TEST_ASSERT(fields[3] == NULL);
1144 TEST_ASSERT(spaceNeeded == requiredCapacity);
1183 TEST_ASSERT(numFields == 5);
1189 TEST_ASSERT(fields[5] == NULL);
1191 TEST_ASSERT(spaceNeeded == requiredCapacity);
1204 TEST_ASSERT(numFields == 2);
1207 TEST_ASSERT(!memcmp(&fields[2],&minus1,sizeof(UChar*)));
1210 TEST_ASSERT(spaceNeeded == requiredCapacity);
1222 TEST_ASSERT(numFields == 3);
1226 TEST_ASSERT(!memcmp(&fields[3],&minus1,sizeof(UChar*)));
1229 TEST_ASSERT(spaceNeeded == requiredCapacity);
1241 TEST_ASSERT(numFields == 5);
1247 TEST_ASSERT(!memcmp(&fields[5],&minus1,sizeof(UChar*)));
1250 TEST_ASSERT(spaceNeeded == requiredCapacity);
1268 TEST_ASSERT(numFields == 5);
1274 TEST_ASSERT(fields[5] == NULL);
1275 TEST_ASSERT(fields[8] == NULL);
1276 TEST_ASSERT(!memcmp(&fields[9],&minus1,sizeof(UChar*)));
1278 TEST_ASSERT(spaceNeeded == requiredCapacity);
1289 TEST_ASSERT(uregex_getTimeLimit(re, &status) == 0);
1291 TEST_ASSERT(uregex_getTimeLimit(re, &status) == 1000);
1294 TEST_ASSERT(status == U_ILLEGAL_ARGUMENT_ERROR);
1296 TEST_ASSERT(uregex_getTimeLimit(re, &status) == 1000);
1303 TEST_ASSERT(uregex_getStackLimit(re, &status) == 8000000);
1305 TEST_ASSERT(uregex_getStackLimit(re, &status) == 40000);
1308 TEST_ASSERT(status == U_ILLEGAL_ARGUMENT_ERROR);
1310 TEST_ASSERT(uregex_getStackLimit(re, &status) == 40000);
1329 TEST_ASSERT(returnedFn == NULL);
1330 TEST_ASSERT(pContext == NULL);
1336 TEST_ASSERT(cbInfo.numCalls == 0);
1337 TEST_ASSERT(uregex_matches(re, -1, &status) == FALSE);
1339 TEST_ASSERT(cbInfo.numCalls > 0);
1343 TEST_ASSERT(returnedFn == &TestCallbackFn);
1344 TEST_ASSERT(pContext == &cbInfo);
1381 TEST_ASSERT(theICUError == U_BUFFER_OVERFLOW_ERROR);
1382 TEST_ASSERT(wordCount==3);
1390 TEST_ASSERT(wordCount==3);
1392 TEST_ASSERT(neededLength1 == neededLength2);
1396 TEST_ASSERT(destFields[3] == NULL);
1431 TEST_ASSERT(status == U_REGEX_INVALID_FLAG);
1438 TEST_ASSERT(status == U_ILLEGAL_ARGUMENT_ERROR && re == NULL);
1457 TEST_ASSERT(clone1 != NULL);
1462 TEST_ASSERT(clone2 != NULL);
1468 TEST_ASSERT(clone3 != NULL);
1478 TEST_ASSERT(result==TRUE);
1485 TEST_ASSERT(result==FALSE);
1488 TEST_ASSERT(result==TRUE);
1515 TEST_ASSERT(resultLen == -1);
1516 TEST_ASSERT(u_strcmp(resultPat, pat) == 0);
1532 TEST_ASSERT(resultLen == 3);
1533 TEST_ASSERT(u_strncmp(resultPat, pat, 3) == 0);
1534 TEST_ASSERT(u_strlen(resultPat) == 3);
1565 TEST_ASSERT( status== U_REGEX_INVALID_STATE);
1570 TEST_ASSERT(result == TRUE);
1576 TEST_ASSERT(result == FALSE);
1582 TEST_ASSERT(result == TRUE);
1618 TEST_ASSERT(resultText != &text1);
1621 TEST_ASSERT(testUTextEqual(resultText, &text1));
1626 TEST_ASSERT(textLength == -1 || textLength == 6);
1629 TEST_ASSERT(resultText != &text1);
1632 TEST_ASSERT(testUTextEqual(resultText, &text1));
1641 TEST_ASSERT(testUTextEqual(resultText, &text2));
1644 TEST_ASSERT(textLength == 7);
1668 TEST_ASSERT(result == FALSE);
1676 TEST_ASSERT(result == TRUE);
1684 TEST_ASSERT(result == TRUE);
1710 TEST_ASSERT(result == TRUE);
1711 TEST_ASSERT(uregex_start(re, 0, &status) == 3);
1712 TEST_ASSERT(uregex_end(re, 0, &status) == 5);
1716 TEST_ASSERT(result == TRUE);
1717 TEST_ASSERT(uregex_start(re, 0, &status) == 11);
1718 TEST_ASSERT(uregex_end(re, 0, &status) == 13);
1722 TEST_ASSERT(result == FALSE);
1729 TEST_ASSERT(result == TRUE);
1730 TEST_ASSERT(uregex_start(re, 0, &status) == 3);
1731 TEST_ASSERT(uregex_end(re, 0, &status) == 5);
1735 TEST_ASSERT(result == TRUE);
1736 TEST_ASSERT(uregex_start(re, 0, &status) == 6);
1737 TEST_ASSERT(uregex_end(re, 0, &status) == 8);
1744 TEST_ASSERT(result == TRUE);
1745 TEST_ASSERT(uregex_start(re, 0, &status) == 13);
1746 TEST_ASSERT(uregex_end(re, 0, &status) == 15);
1750 TEST_ASSERT(result == FALSE);
1774 TEST_ASSERT(result==TRUE);
1781 TEST_ASSERT(utext_getNativeIndex(actual) == 6); /* index of "abc " within "noise abc ..." */
1782 TEST_ASSERT(groupLen == 16); /* length of "abc interior def" */
1793 TEST_ASSERT(9 == utext_getNativeIndex(actual)); /* index of " interior " within "noise abc interior def ... " */
1795 TEST_ASSERT(10 == groupLen); /* length of " interior " */
1804 TEST_ASSERT(status == U_INDEX_OUTOFBOUNDS_ERROR);
1975 TEST_ASSERT(numFields == 3);
1979 TEST_ASSERT(fields[3] == NULL);
2007 TEST_ASSERT(numFields == 2);
2010 TEST_ASSERT(fields[2] == &patternText);
2050 TEST_ASSERT(numFields == 5);
2056 TEST_ASSERT(fields[5] == NULL);
2075 TEST_ASSERT(numFields == 2);
2078 TEST_ASSERT(fields[2] == &patternText);
2099 TEST_ASSERT(numFields == 3);
2103 TEST_ASSERT(fields[3] == &patternText);
2128 TEST_ASSERT(numFields == 5);
2134 TEST_ASSERT(fields[5] == &patternText);
2160 TEST_ASSERT(numFields == 5);
2166 TEST_ASSERT(fields[5] == NULL);
2167 TEST_ASSERT(fields[8] == NULL);
2168 TEST_ASSERT(fields[9] == &patternText);
2205 TEST_ASSERT(uregex_findNext(re, &status));
2206 TEST_ASSERT(uregex_start(re, 0, &status) == 0);
2217 TEST_ASSERT(uregex_findNext(re, &status));
2218 TEST_ASSERT(uregex_start(re, 0, &status) == 2);
2219 TEST_ASSERT(uregex_findNext(re, &status));
2220 TEST_ASSERT(uregex_start(re, 0, &status) == 4);
2221 TEST_ASSERT(FALSE == uregex_findNext(re, &status));
2240 TEST_ASSERT(limit == 0);
2246 TEST_ASSERT(limit == 100);
2281 TEST_ASSERT(status == U_REGEX_STOPPED_BY_CALLER);
2301 TEST_ASSERT(status == U_REGEX_STOPPED_BY_CALLER);