Lines Matching refs:search

246         log_err_status(status, "Error: NULL break iterator is valid for opening search\n");
263 log_err("Error: NULL break iterator is valid for opening search\n");
276 log_err_status(status, "Error: Break iterator is valid for opening search\n");
288 log_err("Error: Break iterator is valid for opening search\n");
318 log_err("Error opening search %s\n", u_errorName(status));
330 log_err("Error opening search %s\n", u_errorName(status));
337 const SearchData search)
342 int32_t matchindex = search.offset[count];
352 uint32_t matchlength = search.size[count];
375 matchindex = search.offset[count];
392 matchindex = search.offset[count];
395 uint32_t matchlength = search.size[count];
417 matchindex = count > 0 ? search.offset[count - 1] : -1;
436 static UBool assertEqual(const SearchData search)
441 UCollator *collator = getCollator(search.collator);
442 UBreakIterator *breaker = getBreakIterator(search.breaker);
445 CHECK_BREAK_BOOL(search.breaker);
447 u_unescape(search.text, text, 128);
448 u_unescape(search.pattern, pattern, 32);
449 ucol_setStrength(collator, search.strength);
453 log_err("Error opening string search %s\n", u_errorName(status));
457 if (!assertEqualWithUStringSearch(strsrch, search)) {
467 static UBool assertCanonicalEqual(const SearchData search)
472 UCollator *collator = getCollator(search.collator);
473 UBreakIterator *breaker = getBreakIterator(search.breaker);
477 CHECK_BREAK_BOOL(search.breaker);
478 u_unescape(search.text, text, 128);
479 u_unescape(search.pattern, pattern, 32);
480 ucol_setStrength(collator, search.strength);
487 log_err("Error opening string search %s\n", u_errorName(status));
492 if (!assertEqualWithUStringSearch(strsrch, search)) {
506 static UBool assertEqualWithAttribute(const SearchData search,
513 UCollator *collator = getCollator(search.collator);
514 UBreakIterator *breaker = getBreakIterator(search.breaker);
517 CHECK_BREAK_BOOL(search.breaker);
518 u_unescape(search.text, text, 128);
519 u_unescape(search.pattern, pattern, 32);
520 ucol_setStrength(collator, search.strength);
528 log_err("Error opening string search %s\n", u_errorName(status));
532 if (!assertEqualWithUStringSearch(strsrch, search)) {
632 log_err("Expected NULL breakiterator from NULL string search\n");
639 log_err("Error opening string search %s\n", u_errorName(status));
668 const SearchData *search = &(BREAKITERATOREXACT[count]);
669 UCollator *collator = getCollator(search->collator);
670 UBreakIterator *breaker = getBreakIterator(search->breaker);
672 u_unescape(search->text, text, 128);
673 u_unescape(search->pattern, pattern, 32);
674 ucol_setStrength(collator, search->strength);
685 if (!assertEqualWithUStringSearch(strsrch, *search)) {
690 search = &(BREAKITERATOREXACT[count + 1]);
691 breaker = getBreakIterator(search->breaker);
699 if (!assertEqualWithUStringSearch(strsrch, *search)) {
775 const SearchData *search = &(OVERLAP[count]);
776 UCollator *collator = getCollator(search->collator);
780 u_unescape(search->text, text, 128);
781 u_unescape(search->pattern, pattern, 32);
796 if (!assertEqualWithUStringSearch(strsrch, *search)) {
800 search = &(NONOVERLAP[count]);
807 if (!assertEqualWithUStringSearch(strsrch, *search)) {
857 log_err("Expected NULL collator from NULL string search\n");
865 log_err("Error opening string search %s\n", u_errorName(status));
920 log_err("Error NULL string search expected returning NULL pattern\n");
924 log_err("Error expected setting pattern in NULL strings search\n");
944 log_err("Error expected setting NULL pattern in strings search\n");
949 log_err("Error expected setting pattern with length 0 in strings search\n");
953 log_err("Error opening string search %s\n", u_errorName(status));
1030 log_err("Error NULL string search should return NULL text\n");
1035 log_err("Error NULL string search should have an error when setting text\n");
1043 log_err("Error opening string search %s\n", u_errorName(status));
1138 SearchData search = BASIC[index ++];
1139 int32_t matchindex = search.offset[count];
1142 u_unescape(search.text, text, 128);
1143 u_unescape(search.pattern, pattern, 32);
1147 ucol_setStrength(usearch_getCollator(strsrch), search.strength);
1150 uint32_t matchlength = search.size[count];
1179 matchindex = search.offset[count + 1] == -1 ? -1 :
1180 search.offset[count + 2];
1181 if (search.offset[count + 1] != -1) {
1182 usearch_setOffset(strsrch, search.offset[count + 1] + 1,
1184 if (usearch_getOffset(strsrch) != search.offset[count + 1] + 1) {
1228 "Attributes for NULL string search should be USEARCH_DEFAULT\n");
1233 log_err("Error opening search %s\n", u_errorName(status));
1301 SearchData search = MATCH[0];
1302 int32_t matchindex = search.offset[count];
1316 "Expected start and length of NULL string search should be USEARCH_DONE\n");
1319 u_unescape(search.text, text, 128);
1320 u_unescape(search.pattern, pattern, 32);
1324 log_err("Error opening string search %s\n", u_errorName(status));
1332 int32_t matchlength = search.size[count];
1350 log_err("Error expecting errors with NULL string search\n");
1378 matchindex = search.offset[count];
1405 SearchData search = MATCH[count];
1415 log_err("Error getting the first and last match of a NULL string search\n");
1417 u_unescape(search.text, text, 128);
1418 u_unescape(search.pattern, pattern, 32);
1422 log_err("Error opening string search %s\n", u_errorName(status));
1430 while (search.offset[size] != -1) {
1434 if (usearch_first(strsrch, &status) != search.offset[0] ||
1438 if (usearch_last(strsrch, &status) != search.offset[size -1] ||
1445 if (usearch_following(strsrch, search.offset[index + 2] - 1,
1446 &status) != search.offset[index + 2] ||
1449 search.offset[index + 2] - 1);
1453 if (usearch_preceding(strsrch, search.offset[index + 1] +
1454 search.size[index + 1] + 1,
1455 &status) != search.offset[index + 1] ||
1458 search.offset[index + 1] + 1);
1493 log_err("Error opening string search %s\n", u_errorName(status));
1514 log_err("Error resetting string search\n");
1519 log_err("Error resetting string search\n");
1570 log_err("Error opening string search %s\n", u_errorName(status));
1614 log_err("Error opening string search %s\n", u_errorName(status));
1639 SearchData search;
1646 log_err_status(status, "Error opening string search %s\n", u_errorName(status));
1650 search = DIACRITICMATCH[count];
1651 while (search.text != NULL) {
1652 if (search.collator != NULL) {
1653 coll = ucol_openFromShortString(search.collator, FALSE, NULL, &status);
1657 ucol_setStrength(coll, search.strength);
1660 log_err("Error opening string search collator(\"%s\") %s\n", search.collator, u_errorName(status));
1666 log_err("Error setting string search collator %s\n", u_errorName(status));
1670 u_unescape(search.text, text, 128);
1671 u_unescape(search.pattern, pattern, 128);
1674 if (!assertEqualWithUStringSearch(strsrch, search)) {
1679 search = DIACRITICMATCH[++count];
1758 const SearchData *search = &(BREAKITERATORCANONICAL[count]);
1759 UCollator *collator = getCollator(search->collator);
1760 UBreakIterator *breaker = getBreakIterator(search->breaker);
1763 u_unescape(search->text, text, 128);
1764 u_unescape(search->pattern, pattern, 32);
1765 ucol_setStrength(collator, search->strength);
1784 if (!assertEqualWithUStringSearch(strsrch, *search)) {
1789 search = &(BREAKITERATOREXACT[count + 1]);
1790 breaker = getBreakIterator(search->breaker);
1800 if (!assertEqualWithUStringSearch(strsrch, *search)) {
1876 const SearchData *search = &(OVERLAPCANONICAL[count]);
1877 UCollator *collator = getCollator(search->collator);
1881 u_unescape(search->text, text, 128);
1882 u_unescape(search->pattern, pattern, 32);
1899 if (!assertEqualWithUStringSearch(strsrch, *search)) {
1903 search = &(NONOVERLAPCANONICAL[count]);
1910 if (!assertEqualWithUStringSearch(strsrch, *search)) {
1951 log_err("Error opening string search %s\n", u_errorName(status));
2017 log_err("Error opening string search %s\n", u_errorName(status));
2092 log_err("Error opening string search %s\n", u_errorName(status));
2193 SearchData search = BASICCANONICAL[index ++];
2194 int32_t matchindex = search.offset[count];
2202 u_unescape(search.text, text, 128);
2203 u_unescape(search.pattern, pattern, 32);
2208 uint32_t matchlength = search.size[count];
2222 matchindex = search.offset[count + 1] == -1 ? -1 :
2223 search.offset[count + 2];
2224 if (search.offset[count + 1] != -1) {
2225 usearch_setOffset(strsrch, search.offset[count + 1] + 1,
2227 if (usearch_getOffset(strsrch) != search.offset[count + 1] + 1) {
2300 log_err("Error opening string search %s\n", u_errorName(status));
2339 log_err("Expected U_UNSUPPORTED_ERROR when trying to instantiate a search object from a CODAN collator, got %s instead\n", u_errorName(status));
2353 UStringSearch *search = NULL;
2370 search = usearch_openFromCollator(value, 2, usrcstr, 22, coll, NULL, &status);
2376 usearch_reset(search);
2377 /* forward search */
2378 pos = usearch_first(search, &status);
2380 log_err("Expected search result: %d; Got instead: %d\n", expectedPos, pos);
2385 usearch_reset(search);
2386 /* backward search */
2387 pos = usearch_last(search, &status);
2389 log_err("Expected search result: %d; Got instead: %d\n", expectedPos, pos);
2396 if (search != NULL) {
2397 usearch_close(search);
2408 UStringSearch *search;
2460 /* open a search looking for 0 */
2461 search = usearch_openFromCollator(pattern, PATTERN_LEN, text,
2465 if (coll != NULL && search != NULL) {
2466 pos = usearch_first(search, &ec);
2467 len = usearch_getMatchedLength(search);
2469 log_err("Expected search result: %d; Got instead: %d\n", expectedPos,
2474 log_err("Expected search result length: %d; Got instead: %d\n",
2478 for (pos = usearch_first(search, &ec); pos != USEARCH_DONE; pos
2479 = usearch_next(search, &ec)) {
2485 log_err("Expected %d search hits, found %d\n", expectedNum, count);
2490 usearch_close(search);
2497 UStringSearch *search;
2517 /* open a search looking for 0 */
2518 search = usearch_openFromCollator (pattern, pLen, text, tLen, coll, NULL, &ec);
2521 if (coll != NULL && search != NULL) {
2522 pos = usearch_first(search, &ec);
2523 len = usearch_getMatchedLength(search);
2526 log_err("Expected search result: %d; Got instead: %d\n", expectedPos, pos);
2530 log_err("Expected search result length: %d; Got instead: %d\n", expectedLen, len);
2535 usearch_reset(search);
2537 pos = usearch_first(search, &ec);
2538 len = usearch_getMatchedLength(search);
2545 usearch_close(search);