Lines Matching refs:strsrch
257 UBool StringSearchTest::assertEqualWithStringSearch(StringSearch *strsrch, in assertEqualWithStringSearch() argument
266 strsrch->setAttribute(USEARCH_ELEMENT_COMPARISON, search->elemCompare, status); in assertEqualWithStringSearch()
272 if (strsrch->getMatchedStart() != USEARCH_DONE || in assertEqualWithStringSearch()
273 strsrch->getMatchedLength() != 0) { in assertEqualWithStringSearch()
280 strsrch->next(status); in assertEqualWithStringSearch()
281 if (matchindex != strsrch->getMatchedStart() || in assertEqualWithStringSearch()
282 matchlength != strsrch->getMatchedLength()) { in assertEqualWithStringSearch()
283 char *str = toCharString(strsrch->getText()); in assertEqualWithStringSearch()
285 str = toCharString(strsrch->getPattern()); in assertEqualWithStringSearch()
288 strsrch->getMatchedStart(), strsrch->getMatchedLength(), in assertEqualWithStringSearch()
294 strsrch->getMatchedText(matchtext); in assertEqualWithStringSearch()
297 strsrch->getText().compareBetween(matchindex, in assertEqualWithStringSearch()
306 strsrch->next(status); in assertEqualWithStringSearch()
307 if (strsrch->getMatchedStart() != USEARCH_DONE || in assertEqualWithStringSearch()
308 strsrch->getMatchedLength() != 0) { in assertEqualWithStringSearch()
309 char *str = toCharString(strsrch->getText()); in assertEqualWithStringSearch()
311 str = toCharString(strsrch->getPattern()); in assertEqualWithStringSearch()
314 strsrch->getMatchedStart(), strsrch->getMatchedLength()); in assertEqualWithStringSearch()
323 strsrch->previous(status); in assertEqualWithStringSearch()
324 if (matchindex != strsrch->getMatchedStart() || in assertEqualWithStringSearch()
325 matchlength != strsrch->getMatchedLength()) { in assertEqualWithStringSearch()
326 char *str = toCharString(strsrch->getText()); in assertEqualWithStringSearch()
328 str = toCharString(strsrch->getPattern()); in assertEqualWithStringSearch()
331 strsrch->getMatchedStart(), strsrch->getMatchedLength(), in assertEqualWithStringSearch()
336 strsrch->getMatchedText(matchtext); in assertEqualWithStringSearch()
339 strsrch->getText().compareBetween(matchindex, in assertEqualWithStringSearch()
349 strsrch->previous(status); in assertEqualWithStringSearch()
350 if (strsrch->getMatchedStart() != USEARCH_DONE || in assertEqualWithStringSearch()
351 strsrch->getMatchedLength() != 0) { in assertEqualWithStringSearch()
352 char *str = toCharString(strsrch->getText()); in assertEqualWithStringSearch()
354 str = toCharString(strsrch->getPattern()); in assertEqualWithStringSearch()
357 strsrch->getMatchedStart(), strsrch->getMatchedLength()); in assertEqualWithStringSearch()
362 UBool isOverlap = (strsrch->getAttribute(USEARCH_OVERLAP) == USEARCH_ON); in assertEqualWithStringSearch()
370 strsrch->following(nextStart, status); in assertEqualWithStringSearch()
373 if (strsrch->getMatchedStart() != USEARCH_DONE || in assertEqualWithStringSearch()
374 strsrch->getMatchedLength() != 0) { in assertEqualWithStringSearch()
375 char *str = toCharString(strsrch->getText()); in assertEqualWithStringSearch()
377 str = toCharString(strsrch->getPattern()); in assertEqualWithStringSearch()
381 strsrch->getMatchedStart(), strsrch->getMatchedLength()); in assertEqualWithStringSearch()
389 if (strsrch->getMatchedStart() != matchindex in assertEqualWithStringSearch()
390 || strsrch->getMatchedLength() != matchlength in assertEqualWithStringSearch()
392 char *str = toCharString(strsrch->getText()); in assertEqualWithStringSearch()
394 str = toCharString(strsrch->getPattern()); in assertEqualWithStringSearch()
398 strsrch->getMatchedStart(), strsrch->getMatchedLength(), in assertEqualWithStringSearch()
403 if (isOverlap || strsrch->getMatchedLength() == 0) { in assertEqualWithStringSearch()
404 nextStart = strsrch->getMatchedStart() + 1; in assertEqualWithStringSearch()
406 nextStart = strsrch->getMatchedStart() + strsrch->getMatchedLength(); in assertEqualWithStringSearch()
418 nextStart = strsrch->getText().length(); in assertEqualWithStringSearch()
421 strsrch->preceding(nextStart, status); in assertEqualWithStringSearch()
424 if (strsrch->getMatchedStart() != USEARCH_DONE || strsrch->getMatchedLength() != 0) { in assertEqualWithStringSearch()
425 char *str = toCharString(strsrch->getText()); in assertEqualWithStringSearch()
427 str = toCharString(strsrch->getPattern()); in assertEqualWithStringSearch()
431 strsrch->getMatchedStart(), in assertEqualWithStringSearch()
432 strsrch->getMatchedLength()); in assertEqualWithStringSearch()
441 if (strsrch->getMatchedStart() != matchindex in assertEqualWithStringSearch()
442 || strsrch->getMatchedLength() != matchlength in assertEqualWithStringSearch()
444 char *str = toCharString(strsrch->getText()); in assertEqualWithStringSearch()
446 str = toCharString(strsrch->getPattern()); in assertEqualWithStringSearch()
450 strsrch->getMatchedStart(), strsrch->getMatchedLength(), in assertEqualWithStringSearch()
459 strsrch->setAttribute(USEARCH_ELEMENT_COMPARISON, USEARCH_STANDARD_ELEMENT_COMPARISON, status); in assertEqualWithStringSearch()
469 StringSearch *strsrch, *strsrch2; in assertEqual() local
490 strsrch = new StringSearch(pattern, text, (RuleBasedCollator *)collator, in assertEqual()
497 if (!assertEqualWithStringSearch(strsrch, search)) { in assertEqual()
499 delete strsrch; in assertEqual()
504 strsrch2 = strsrch->clone(); in assertEqual()
505 if( strsrch2 == strsrch || *strsrch2 != *strsrch || in assertEqual()
510 delete strsrch; in assertEqual()
517 delete strsrch; in assertEqual()
526 StringSearch *strsrch; in assertCanonicalEqual() local
550 strsrch = new StringSearch(pattern, text, (RuleBasedCollator *)collator, in assertCanonicalEqual()
552 strsrch->setAttribute(USEARCH_CANONICAL_MATCH, USEARCH_ON, status); in assertCanonicalEqual()
559 if (!assertEqualWithStringSearch(strsrch, search)) { in assertCanonicalEqual()
567 delete strsrch; in assertCanonicalEqual()
579 StringSearch *strsrch; in assertEqualWithAttribute() local
602 strsrch = new StringSearch(pattern, text, (RuleBasedCollator *)collator, in assertEqualWithAttribute()
604 strsrch->setAttribute(USEARCH_CANONICAL_MATCH, canonical, status); in assertEqualWithAttribute()
605 strsrch->setAttribute(USEARCH_OVERLAP, overlap, status); in assertEqualWithAttribute()
612 if (!assertEqualWithStringSearch(strsrch, search)) { in assertEqualWithAttribute()
614 delete strsrch; in assertEqualWithAttribute()
618 delete strsrch; in assertEqualWithAttribute()
882 StringSearch *strsrch = new StringSearch(pattern, text, m_en_us_, NULL, in TestBreakIterator() local
888 strsrch->setBreakIterator(NULL, status); in TestBreakIterator()
889 if (U_FAILURE(status) || strsrch->getBreakIterator() != NULL) { in TestBreakIterator()
893 strsrch->setBreakIterator(m_en_characterbreaker_, status); in TestBreakIterator()
895 strsrch->getBreakIterator() != m_en_characterbreaker_) { in TestBreakIterator()
899 strsrch->setBreakIterator(m_en_wordbreaker_, status); in TestBreakIterator()
901 strsrch->getBreakIterator() != m_en_wordbreaker_) { in TestBreakIterator()
905 delete strsrch; in TestBreakIterator()
913 StringSearch *strsrch; in TestBreakIterator() local
924 strsrch = new StringSearch(pattern, text, collator, breaker, status); in TestBreakIterator()
926 strsrch->getBreakIterator() != breaker) { in TestBreakIterator()
928 if (strsrch != NULL) { in TestBreakIterator()
929 delete strsrch; in TestBreakIterator()
932 if (!assertEqualWithStringSearch(strsrch, search)) { in TestBreakIterator()
934 delete strsrch; in TestBreakIterator()
941 strsrch->setBreakIterator(breaker, status); in TestBreakIterator()
943 strsrch->getBreakIterator() != breaker) { in TestBreakIterator()
945 delete strsrch; in TestBreakIterator()
947 strsrch->reset(); in TestBreakIterator()
948 if (!assertEqualWithStringSearch(strsrch, search)) { in TestBreakIterator()
951 delete strsrch; in TestBreakIterator()
1016 StringSearch *strsrch = new StringSearch(pattern, text, in TestOverlap() local
1020 strsrch->setAttribute(USEARCH_OVERLAP, USEARCH_ON, status); in TestOverlap()
1022 strsrch->getAttribute(USEARCH_OVERLAP) != USEARCH_ON) { in TestOverlap()
1025 if (!assertEqualWithStringSearch(strsrch, search)) { in TestOverlap()
1026 delete strsrch; in TestOverlap()
1031 strsrch->setAttribute(USEARCH_OVERLAP, USEARCH_OFF, status); in TestOverlap()
1033 strsrch->getAttribute(USEARCH_OVERLAP) != USEARCH_OFF) { in TestOverlap()
1036 strsrch->reset(); in TestOverlap()
1037 if (!assertEqualWithStringSearch(strsrch, search)) { in TestOverlap()
1038 delete strsrch; in TestOverlap()
1043 delete strsrch; in TestOverlap()
1059 StringSearch *strsrch = new StringSearch(pattern, text, m_en_us_, NULL, in TestCollator() local
1063 delete strsrch; in TestCollator()
1066 if (!assertEqualWithStringSearch(strsrch, &COLLATOR[0])) { in TestCollator()
1067 delete strsrch; in TestCollator()
1079 delete strsrch; in TestCollator()
1084 strsrch->setCollator(tailored, status); in TestCollator()
1085 if (U_FAILURE(status) || (*strsrch->getCollator()) != (*tailored)) { in TestCollator()
1087 delete strsrch; in TestCollator()
1090 strsrch->reset(); in TestCollator()
1091 if (!assertEqualWithStringSearch(strsrch, &COLLATOR[1])) { in TestCollator()
1092 delete strsrch; in TestCollator()
1097 strsrch->setCollator(m_en_us_, status); in TestCollator()
1098 strsrch->reset(); in TestCollator()
1099 if (U_FAILURE(status) || (*strsrch->getCollator()) != (*m_en_us_)) { in TestCollator()
1101 delete strsrch; in TestCollator()
1104 if (!assertEqualWithStringSearch(strsrch, &COLLATOR[0])) { in TestCollator()
1107 delete strsrch; in TestCollator()
1125 StringSearch *strsrch = new StringSearch(pattern, text, m_en_us_, NULL, in TestPattern() local
1131 if (strsrch != NULL) { in TestPattern()
1132 delete strsrch; in TestPattern()
1136 if (strsrch->getPattern() != pattern) { in TestPattern()
1139 if (!assertEqualWithStringSearch(strsrch, &PATTERN[0])) { in TestPattern()
1141 if (strsrch != NULL) { in TestPattern()
1142 delete strsrch; in TestPattern()
1149 strsrch->setPattern(pattern, status); in TestPattern()
1150 if (pattern != strsrch->getPattern()) { in TestPattern()
1153 if (strsrch != NULL) { in TestPattern()
1154 delete strsrch; in TestPattern()
1158 strsrch->reset(); in TestPattern()
1162 if (!assertEqualWithStringSearch(strsrch, &PATTERN[1])) { in TestPattern()
1164 if (strsrch != NULL) { in TestPattern()
1165 delete strsrch; in TestPattern()
1172 strsrch->setPattern(pattern, status); in TestPattern()
1173 if (pattern != strsrch->getPattern()) { in TestPattern()
1176 if (strsrch != NULL) { in TestPattern()
1177 delete strsrch; in TestPattern()
1181 strsrch->reset(); in TestPattern()
1185 if (!assertEqualWithStringSearch(strsrch, &PATTERN[0])) { in TestPattern()
1187 if (strsrch != NULL) { in TestPattern()
1188 delete strsrch; in TestPattern()
1198 strsrch->setPattern(pattern, status); in TestPattern()
1203 if (strsrch != NULL) { in TestPattern()
1204 delete strsrch; in TestPattern()
1219 StringSearch *strsrch = new StringSearch(pattern, text, m_en_us_, NULL, in TestText() local
1225 if (text != strsrch->getText()) { in TestText()
1228 if (!assertEqualWithStringSearch(strsrch, &TEXT[0])) { in TestText()
1229 delete strsrch; in TestText()
1235 strsrch->setText(text, status); in TestText()
1236 if (text != strsrch->getText()) { in TestText()
1238 delete strsrch; in TestText()
1244 if (!assertEqualWithStringSearch(strsrch, &TEXT[1])) { in TestText()
1245 delete strsrch; in TestText()
1252 strsrch->setText(chariter, status); in TestText()
1253 if (text != strsrch->getText()) { in TestText()
1255 delete strsrch; in TestText()
1261 if (!assertEqualWithStringSearch(strsrch, &TEXT[0])) { in TestText()
1264 delete strsrch; in TestText()
1284 StringSearch *strsrch = new StringSearch(pattern, text, m_en_us_, in TestGetSetOffset() local
1287 strsrch->setOffset(-1, status); in TestGetSetOffset()
1291 strsrch->setOffset(128, status); in TestGetSetOffset()
1305 strsrch->setText(text, status); in TestGetSetOffset()
1306 strsrch->setPattern(pattern, status); in TestGetSetOffset()
1307 strsrch->getCollator()->setStrength(getECollationStrength( in TestGetSetOffset()
1309 strsrch->reset(); in TestGetSetOffset()
1315 strsrch->next(status); in TestGetSetOffset()
1316 if (matchindex != strsrch->getMatchedStart() || in TestGetSetOffset()
1317 matchlength != strsrch->getMatchedLength()) { in TestGetSetOffset()
1318 char *str = toCharString(strsrch->getText()); in TestGetSetOffset()
1320 str = toCharString(strsrch->getPattern()); in TestGetSetOffset()
1323 strsrch->getMatchedStart(), in TestGetSetOffset()
1324 strsrch->getMatchedLength()); in TestGetSetOffset()
1330 strsrch->setOffset(search.offset[count + 1] + 1, status); in TestGetSetOffset()
1331 if (strsrch->getOffset() != search.offset[count + 1] + 1) { in TestGetSetOffset()
1339 strsrch->next(status); in TestGetSetOffset()
1340 if (strsrch->getMatchedStart() != USEARCH_DONE) { in TestGetSetOffset()
1341 char *str = toCharString(strsrch->getText()); in TestGetSetOffset()
1343 str = toCharString(strsrch->getPattern()); in TestGetSetOffset()
1346 strsrch->getMatchedStart(), in TestGetSetOffset()
1347 strsrch->getMatchedLength()); in TestGetSetOffset()
1351 strsrch->getCollator()->setStrength(getECollationStrength( in TestGetSetOffset()
1353 delete strsrch; in TestGetSetOffset()
1361 StringSearch *strsrch = new StringSearch(pattern, text, m_en_us_, NULL, in TestGetSetAttribute() local
1368 strsrch->setAttribute(USEARCH_OVERLAP, USEARCH_DEFAULT, status); in TestGetSetAttribute()
1370 strsrch->getAttribute(USEARCH_OVERLAP) != USEARCH_OFF) { in TestGetSetAttribute()
1373 strsrch->setAttribute(USEARCH_OVERLAP, USEARCH_ON, status); in TestGetSetAttribute()
1375 strsrch->getAttribute(USEARCH_OVERLAP) != USEARCH_ON) { in TestGetSetAttribute()
1378 strsrch->setAttribute(USEARCH_OVERLAP, USEARCH_OFF, status); in TestGetSetAttribute()
1380 strsrch->getAttribute(USEARCH_OVERLAP) != USEARCH_OFF) { in TestGetSetAttribute()
1383 strsrch->setAttribute(USEARCH_OVERLAP, USEARCH_ATTRIBUTE_VALUE_COUNT, in TestGetSetAttribute()
1389 strsrch->setAttribute(USEARCH_CANONICAL_MATCH, USEARCH_DEFAULT, status); in TestGetSetAttribute()
1391 strsrch->getAttribute(USEARCH_CANONICAL_MATCH) != USEARCH_OFF) { in TestGetSetAttribute()
1394 strsrch->setAttribute(USEARCH_CANONICAL_MATCH, USEARCH_ON, status); in TestGetSetAttribute()
1396 strsrch->getAttribute(USEARCH_CANONICAL_MATCH) != USEARCH_ON) { in TestGetSetAttribute()
1399 strsrch->setAttribute(USEARCH_CANONICAL_MATCH, USEARCH_OFF, status); in TestGetSetAttribute()
1401 strsrch->getAttribute(USEARCH_CANONICAL_MATCH) != USEARCH_OFF) { in TestGetSetAttribute()
1404 strsrch->setAttribute(USEARCH_CANONICAL_MATCH, in TestGetSetAttribute()
1410 strsrch->setAttribute(USEARCH_ATTRIBUTE_COUNT, USEARCH_DEFAULT, status); in TestGetSetAttribute()
1415 delete strsrch; in TestGetSetAttribute()
1430 StringSearch *strsrch = new StringSearch(pattern, text, m_en_us_, NULL, in TestGetMatch() local
1434 if (strsrch != NULL) { in TestGetMatch()
1435 delete strsrch; in TestGetMatch()
1445 strsrch->next(status); in TestGetMatch()
1446 if (matchindex != strsrch->getMatchedStart() || in TestGetMatch()
1447 matchlength != strsrch->getMatchedLength()) { in TestGetMatch()
1448 char *str = toCharString(strsrch->getText()); in TestGetMatch()
1450 str = toCharString(strsrch->getPattern()); in TestGetMatch()
1452 errln("Error match found at %d %d", strsrch->getMatchedStart(), in TestGetMatch()
1453 strsrch->getMatchedLength()); in TestGetMatch()
1459 strsrch->getMatchedText(matchtext); in TestGetMatch()
1466 strsrch->next(status); in TestGetMatch()
1467 if (strsrch->getMatchedStart() != USEARCH_DONE || in TestGetMatch()
1468 strsrch->getMatchedLength() != 0) { in TestGetMatch()
1472 strsrch->getMatchedText(matchtext); in TestGetMatch()
1476 delete strsrch; in TestGetMatch()
1493 StringSearch *strsrch = new StringSearch(pattern, text, m_en_us_, in TestSetMatch() local
1497 if (strsrch != NULL) { in TestSetMatch()
1498 delete strsrch; in TestSetMatch()
1508 if (strsrch->first(status) != search.offset[0] || U_FAILURE(status)) { in TestSetMatch()
1511 if (strsrch->last(status) != search.offset[size -1] || in TestSetMatch()
1519 if (strsrch->following(search.offset[index + 2] - 1, status) in TestSetMatch()
1526 if (strsrch->preceding(search.offset[index + 1] + in TestSetMatch()
1537 if (strsrch->following(text.length(), status) != USEARCH_DONE) { in TestSetMatch()
1540 if (strsrch->preceding(0, status) != USEARCH_DONE) { in TestSetMatch()
1544 delete strsrch; in TestSetMatch()
1553 StringSearch *strsrch = new StringSearch(pattern, text, m_en_us_, NULL, in TestReset() local
1557 if (strsrch != NULL) { in TestReset()
1558 delete strsrch; in TestReset()
1562 strsrch->setAttribute(USEARCH_OVERLAP, USEARCH_ON, status); in TestReset()
1563 strsrch->setAttribute(USEARCH_CANONICAL_MATCH, USEARCH_ON, status); in TestReset()
1564 strsrch->setOffset(9, status); in TestReset()
1569 strsrch->reset(); in TestReset()
1570 if (strsrch->getAttribute(USEARCH_OVERLAP) != USEARCH_OFF || in TestReset()
1571 strsrch->getAttribute(USEARCH_CANONICAL_MATCH) != USEARCH_OFF || in TestReset()
1572 strsrch->getOffset() != 0 || strsrch->getMatchedLength() != 0 || in TestReset()
1573 strsrch->getMatchedStart() != USEARCH_DONE) { in TestReset()
1576 strsrch->previous(status); in TestReset()
1577 if (strsrch->getMatchedStart() != 7 || in TestReset()
1578 strsrch->getMatchedLength() != 1) { in TestReset()
1582 delete strsrch; in TestReset()
1611 StringSearch *strsrch = new StringSearch(pattern, text, collator, NULL, in TestContraction() local
1623 strsrch->setText(text, status); in TestContraction()
1624 strsrch->setPattern(pattern, status); in TestContraction()
1625 if (!assertEqualWithStringSearch(strsrch, &CONTRACTION[count])) { in TestContraction()
1630 delete strsrch; in TestContraction()
1651 StringSearch *strsrch = new StringSearch(pattern, text, collator, NULL, in TestIgnorable() local
1664 strsrch->setText(text, status); in TestIgnorable()
1665 strsrch->setPattern(pattern, status); in TestIgnorable()
1666 if (!assertEqualWithStringSearch(strsrch, &IGNORABLE[count])) { in TestIgnorable()
1671 delete strsrch; in TestIgnorable()
1681 StringSearch *strsrch = NULL; in TestDiacriticMatch() local
1692 strsrch = new StringSearch(pattern, text, coll, getBreakIterator(search->breaker), status); in TestDiacriticMatch()
1701 strsrch->setText(text, status); in TestDiacriticMatch()
1702 strsrch->setPattern(pattern, status); in TestDiacriticMatch()
1703 if (!assertEqualWithStringSearch(strsrch, search)) { in TestDiacriticMatch()
1707 delete strsrch; in TestDiacriticMatch()
1770 StringSearch *strsrch = new StringSearch(pattern, text, collator, in TestBreakIteratorCanonical() local
1776 strsrch->setAttribute(USEARCH_CANONICAL_MATCH, USEARCH_ON, status); in TestBreakIteratorCanonical()
1778 strsrch->getBreakIterator() != breaker) { in TestBreakIteratorCanonical()
1780 delete strsrch; in TestBreakIteratorCanonical()
1783 if (!assertEqualWithStringSearch(strsrch, search)) { in TestBreakIteratorCanonical()
1785 delete strsrch; in TestBreakIteratorCanonical()
1794 breaker->setText(strsrch->getText()); in TestBreakIteratorCanonical()
1795 strsrch->setBreakIterator(breaker, status); in TestBreakIteratorCanonical()
1796 if (U_FAILURE(status) || strsrch->getBreakIterator() != breaker) { in TestBreakIteratorCanonical()
1798 delete strsrch; in TestBreakIteratorCanonical()
1801 strsrch->reset(); in TestBreakIteratorCanonical()
1802 strsrch->setAttribute(USEARCH_CANONICAL_MATCH, USEARCH_ON, status); in TestBreakIteratorCanonical()
1803 if (!assertEqualWithStringSearch(strsrch, search)) { in TestBreakIteratorCanonical()
1807 delete strsrch; in TestBreakIteratorCanonical()
1873 StringSearch *strsrch = new StringSearch(pattern, text, collator, in TestOverlapCanonical() local
1875 strsrch->setAttribute(USEARCH_CANONICAL_MATCH, USEARCH_ON, status); in TestOverlapCanonical()
1876 strsrch->setAttribute(USEARCH_OVERLAP, USEARCH_ON, status); in TestOverlapCanonical()
1878 strsrch->getAttribute(USEARCH_OVERLAP) != USEARCH_ON) { in TestOverlapCanonical()
1881 if (!assertEqualWithStringSearch(strsrch, search)) { in TestOverlapCanonical()
1882 delete strsrch; in TestOverlapCanonical()
1886 strsrch->setAttribute(USEARCH_OVERLAP, USEARCH_OFF, status); in TestOverlapCanonical()
1888 strsrch->getAttribute(USEARCH_OVERLAP) != USEARCH_OFF) { in TestOverlapCanonical()
1891 strsrch->reset(); in TestOverlapCanonical()
1892 if (!assertEqualWithStringSearch(strsrch, search)) { in TestOverlapCanonical()
1893 delete strsrch; in TestOverlapCanonical()
1898 delete strsrch; in TestOverlapCanonical()
1914 StringSearch *strsrch = new StringSearch(pattern, text, m_en_us_, in TestCollatorCanonical() local
1916 strsrch->setAttribute(USEARCH_CANONICAL_MATCH, USEARCH_ON, status); in TestCollatorCanonical()
1920 if (!assertEqualWithStringSearch(strsrch, &COLLATORCANONICAL[0])) { in TestCollatorCanonical()
1921 delete strsrch; in TestCollatorCanonical()
1936 strsrch->setCollator(tailored, status); in TestCollatorCanonical()
1937 if (U_FAILURE(status) || *(strsrch->getCollator()) != *tailored) { in TestCollatorCanonical()
1940 strsrch->reset(); in TestCollatorCanonical()
1941 strsrch->setAttribute(USEARCH_CANONICAL_MATCH, USEARCH_ON, status); in TestCollatorCanonical()
1942 if (!assertEqualWithStringSearch(strsrch, &COLLATORCANONICAL[1])) { in TestCollatorCanonical()
1943 delete strsrch; in TestCollatorCanonical()
1951 strsrch->setCollator(m_en_us_, status); in TestCollatorCanonical()
1952 strsrch->reset(); in TestCollatorCanonical()
1953 if (U_FAILURE(status) || *(strsrch->getCollator()) != *m_en_us_) { in TestCollatorCanonical()
1956 if (!assertEqualWithStringSearch(strsrch, &COLLATORCANONICAL[0])) { in TestCollatorCanonical()
1958 delete strsrch; in TestCollatorCanonical()
1980 StringSearch *strsrch = new StringSearch(pattern, text, m_en_us_, NULL, in TestPatternCanonical() local
1982 strsrch->setAttribute(USEARCH_CANONICAL_MATCH, USEARCH_ON, status); in TestPatternCanonical()
1987 if (pattern != strsrch->getPattern()) { in TestPatternCanonical()
1990 if (!assertEqualWithStringSearch(strsrch, &PATTERNCANONICAL[0])) { in TestPatternCanonical()
1996 strsrch->setPattern(pattern, status); in TestPatternCanonical()
1997 if (pattern != strsrch->getPattern()) { in TestPatternCanonical()
2001 strsrch->reset(); in TestPatternCanonical()
2002 strsrch->setAttribute(USEARCH_CANONICAL_MATCH, USEARCH_ON, status); in TestPatternCanonical()
2006 if (!assertEqualWithStringSearch(strsrch, &PATTERNCANONICAL[1])) { in TestPatternCanonical()
2012 strsrch->setPattern(pattern, status); in TestPatternCanonical()
2013 if (pattern != strsrch->getPattern()) { in TestPatternCanonical()
2017 strsrch->reset(); in TestPatternCanonical()
2018 strsrch->setAttribute(USEARCH_CANONICAL_MATCH, USEARCH_ON, status); in TestPatternCanonical()
2022 if (!assertEqualWithStringSearch(strsrch, &PATTERNCANONICAL[0])) { in TestPatternCanonical()
2027 if (strsrch != NULL) { in TestPatternCanonical()
2028 delete strsrch; in TestPatternCanonical()
2043 StringSearch *strsrch = new StringSearch(pattern, text, m_en_us_, NULL, in TestTextCanonical() local
2045 strsrch->setAttribute(USEARCH_CANONICAL_MATCH, USEARCH_ON, status); in TestTextCanonical()
2051 if (text != strsrch->getText()) { in TestTextCanonical()
2054 if (!assertEqualWithStringSearch(strsrch, &TEXTCANONICAL[0])) { in TestTextCanonical()
2060 strsrch->setText(text, status); in TestTextCanonical()
2061 if (text != strsrch->getText()) { in TestTextCanonical()
2068 if (!assertEqualWithStringSearch(strsrch, &TEXTCANONICAL[1])) { in TestTextCanonical()
2074 strsrch->setText(text, status); in TestTextCanonical()
2075 if (text != strsrch->getText()) { in TestTextCanonical()
2082 if (!assertEqualWithStringSearch(strsrch, &TEXTCANONICAL[0])) { in TestTextCanonical()
2086 if (strsrch != NULL) { in TestTextCanonical()
2087 delete strsrch; in TestTextCanonical()
2109 StringSearch *strsrch = new StringSearch(pattern, text, m_en_us_, NULL, in TestGetSetOffsetCanonical() local
2111 Collator *collator = strsrch->getCollator(); in TestGetSetOffsetCanonical()
2115 strsrch->setAttribute(USEARCH_CANONICAL_MATCH, USEARCH_ON, status); in TestGetSetOffsetCanonical()
2117 strsrch->setOffset(-1, status); in TestGetSetOffsetCanonical()
2121 strsrch->setOffset(128, status); in TestGetSetOffsetCanonical()
2140 strsrch->setText(text, status); in TestGetSetOffsetCanonical()
2142 strsrch->setPattern(pattern, status); in TestGetSetOffsetCanonical()
2148 strsrch->next(status); in TestGetSetOffsetCanonical()
2149 if (matchindex != strsrch->getMatchedStart() || in TestGetSetOffsetCanonical()
2150 matchlength != strsrch->getMatchedLength()) { in TestGetSetOffsetCanonical()
2151 char *str = toCharString(strsrch->getText()); in TestGetSetOffsetCanonical()
2153 str = toCharString(strsrch->getPattern()); in TestGetSetOffsetCanonical()
2156 strsrch->getMatchedStart(), in TestGetSetOffsetCanonical()
2157 strsrch->getMatchedLength()); in TestGetSetOffsetCanonical()
2163 strsrch->setOffset(search.offset[count + 1] + 1, status); in TestGetSetOffsetCanonical()
2164 if (strsrch->getOffset() != search.offset[count + 1] + 1) { in TestGetSetOffsetCanonical()
2172 strsrch->next(status); in TestGetSetOffsetCanonical()
2173 if (strsrch->getMatchedStart() != USEARCH_DONE) { in TestGetSetOffsetCanonical()
2174 char *str = toCharString(strsrch->getText()); in TestGetSetOffsetCanonical()
2176 str = toCharString(strsrch->getPattern()); in TestGetSetOffsetCanonical()
2178 errln("Error match found at %d %d", strsrch->getMatchedStart(), in TestGetSetOffsetCanonical()
2179 strsrch->getMatchedLength()); in TestGetSetOffsetCanonical()
2186 delete strsrch; in TestGetSetOffsetCanonical()
2216 StringSearch *strsrch = new StringSearch(pattern, text, collator, NULL, in TestContractionCanonical() local
2218 strsrch->setAttribute(USEARCH_CANONICAL_MATCH, USEARCH_ON, status); in TestContractionCanonical()
2229 strsrch->setText(text, status); in TestContractionCanonical()
2230 strsrch->setPattern(pattern, status); in TestContractionCanonical()
2231 if (!assertEqualWithStringSearch(strsrch, in TestContractionCanonical()
2237 delete strsrch; in TestContractionCanonical()
2250 StringSearch *strsrch = new StringSearch(pattern, text, m_en_us_, NULL, in TestUClassID() local
2252 id = *((char *)strsrch->getDynamicClassID()); in TestUClassID()
2256 delete strsrch; in TestUClassID()