• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/ICU-531.30/icuSources/test/cintltst/

Lines Matching defs: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)
341 int32_t matchindex = search.offset[count];
348 usearch_setAttribute(strsrch, USEARCH_ELEMENT_COMPARISON, search.elemCompare, &status);
360 matchlength = search.size[count];
383 matchindex = search.offset[count];
399 matchindex = search.offset[count];
402 matchlength = search.size[count];
424 matchindex = count > 0 ? search.offset[count - 1] : -1;
445 matchindex = search.offset[count];
467 matchlength = search.size[count];
489 matchindex = search.offset[count];
494 while (search.offset[count + 1] >= 0) {
518 matchindex = search.offset[count];
519 matchlength = search.size[count];
542 static UBool assertEqual(const SearchData search)
547 UCollator *collator = getCollator(search.collator);
548 UBreakIterator *breaker = getBreakIterator(search.breaker);
551 CHECK_BREAK_BOOL(search.breaker);
553 u_unescape(search.text, text, 128);
554 u_unescape(search.pattern, pattern, 32);
555 ucol_setStrength(collator, search.strength);
559 log_err("Error opening string search %s\n", u_errorName(status));
563 if (!assertEqualWithUStringSearch(strsrch, search)) {
573 static UBool assertCanonicalEqual(const SearchData search)
578 UCollator *collator = getCollator(search.collator);
579 UBreakIterator *breaker = getBreakIterator(search.breaker);
583 CHECK_BREAK_BOOL(search.breaker);
584 u_unescape(search.text, text, 128);
585 u_unescape(search.pattern, pattern, 32);
586 ucol_setStrength(collator, search.strength);
593 log_err("Error opening string search %s\n", u_errorName(status));
598 if (!assertEqualWithUStringSearch(strsrch, search)) {
612 static UBool assertEqualWithAttribute(const SearchData search,
619 UCollator *collator = getCollator(search.collator);
620 UBreakIterator *breaker = getBreakIterator(search.breaker);
623 CHECK_BREAK_BOOL(search.breaker);
624 u_unescape(search.text, text, 128);
625 u_unescape(search.pattern, pattern, 32);
626 ucol_setStrength(collator, search.strength);
634 log_err("Error opening string search %s\n", u_errorName(status));
638 if (!assertEqualWithUStringSearch(strsrch, search)) {
738 log_err("Expected NULL breakiterator from NULL string search\n");
745 log_err("Error opening string search %s\n", u_errorName(status));
774 const SearchData *search = &(BREAKITERATOREXACT[count]);
775 UCollator *collator = getCollator(search->collator);
776 UBreakIterator *breaker = getBreakIterator(search->breaker);
778 u_unescape(search->text, text, 128);
779 u_unescape(search->pattern, pattern, 32);
780 ucol_setStrength(collator, search->strength);
791 if (!assertEqualWithUStringSearch(strsrch, *search)) {
796 search = &(BREAKITERATOREXACT[count + 1]);
797 breaker = getBreakIterator(search->breaker);
805 if (!assertEqualWithUStringSearch(strsrch, *search)) {
881 const SearchData *search = &(OVERLAP[count]);
882 UCollator *collator = getCollator(search->collator);
886 u_unescape(search->text, text, 128);
887 u_unescape(search->pattern, pattern, 32);
902 if (!assertEqualWithUStringSearch(strsrch, *search)) {
906 search = &(NONOVERLAP[count]);
913 if (!assertEqualWithUStringSearch(strsrch, *search)) {
963 log_err("Expected NULL collator from NULL string search\n");
971 log_err("Error opening string search %s\n", u_errorName(status));
1026 log_err("Error NULL string search expected returning NULL pattern\n");
1030 log_err("Error expected setting pattern in NULL strings search\n");
1050 log_err("Error expected setting NULL pattern in strings search\n");
1055 log_err("Error expected setting pattern with length 0 in strings search\n");
1059 log_err("Error opening string search %s\n", u_errorName(status));
1136 log_err("Error NULL string search should return NULL text\n");
1141 log_err("Error NULL string search should have an error when setting text\n");
1149 log_err("Error opening string search %s\n", u_errorName(status));
1244 SearchData search = BASIC[searchDataIndex ++];
1245 int32_t matchindex = search.offset[count];
1248 u_unescape(search.text, text, 128);
1249 u_unescape(search.pattern, pattern, 32);
1253 ucol_setStrength(usearch_getCollator(strsrch), search.strength);
1256 uint32_t matchlength = search.size[count];
1285 matchindex = search.offset[count + 1] == -1 ? -1 :
1286 search.offset[count + 2];
1287 if (search.offset[count + 1] != -1) {
1288 usearch_setOffset(strsrch, search.offset[count + 1] + 1,
1290 if (usearch_getOffset(strsrch) != search.offset[count + 1] + 1) {
1334 "Attributes for NULL string search should be USEARCH_DEFAULT\n");
1339 log_err("Error opening search %s\n", u_errorName(status));
1407 SearchData search = MATCH[0];
1408 int32_t matchindex = search.offset[count];
1422 "Expected start and length of NULL string search should be USEARCH_DONE\n");
1425 u_unescape(search.text, text, 128);
1426 u_unescape(search.pattern, pattern, 32);
1430 log_err("Error opening string search %s\n", u_errorName(status));
1438 int32_t matchlength = search.size[count];
1456 log_err("Error expecting errors with NULL string search\n");
1484 matchindex = search.offset[count];
1511 SearchData search = MATCH[count];
1521 log_err("Error getting the first and last match of a NULL string search\n");
1523 u_unescape(search.text, text, 128);
1524 u_unescape(search.pattern, pattern, 32);
1528 log_err("Error opening string search %s\n", u_errorName(status));
1536 while (search.offset[size] != -1) {
1540 if (usearch_first(strsrch, &status) != search.offset[0] ||
1544 if (usearch_last(strsrch, &status) != search.offset[size -1] ||
1551 if (usearch_following(strsrch, search.offset[offsetIndex + 2] - 1,
1552 &status) != search.offset[offsetIndex + 2] ||
1555 search.offset[offsetIndex + 2] - 1);
1559 if (usearch_preceding(strsrch, search.offset[offsetIndex + 1] +
1560 search.size[offsetIndex + 1] + 1,
1561 &status) != search.offset[offsetIndex + 1] ||
1564 search.offset[offsetIndex + 1] + 1);
1599 log_err("Error opening string search %s\n", u_errorName(status));
1620 log_err("Error resetting string search\n");
1625 log_err("Error resetting string search\n");
1676 log_err("Error opening string search %s\n", u_errorName(status));
1720 log_err("Error opening string search %s\n", u_errorName(status));
1745 SearchData search;
1752 log_err_status(status, "Error opening string search %s\n", u_errorName(status));
1756 search = DIACRITICMATCH[count];
1757 while (search.text != NULL) {
1758 if (search.collator != NULL) {
1759 coll = ucol_openFromShortString(search.collator, FALSE, NULL, &status);
1763 ucol_setStrength(coll, search.strength);
1766 log_err("Error opening string search collator(\"%s\") %s\n", search.collator, u_errorName(status));
1772 log_err("Error setting string search collator %s\n", u_errorName(status));
1776 u_unescape(search.text, text, 128);
1777 u_unescape(search.pattern, pattern, 128);
1780 if (!assertEqualWithUStringSearch(strsrch, search)) {
1785 search = DIACRITICMATCH[++count];
1864 const SearchData *search = &(BREAKITERATORCANONICAL[count]);
1865 UCollator *collator = getCollator(search->collator);
1866 UBreakIterator *breaker = getBreakIterator(search->breaker);
1869 u_unescape(search->text, text, 128);
1870 u_unescape(search->pattern, pattern, 32);
1871 ucol_setStrength(collator, search->strength);
1890 if (!assertEqualWithUStringSearch(strsrch, *search)) {
1895 search = &(BREAKITERATOREXACT[count + 1]);
1896 breaker = getBreakIterator(search->breaker);
1906 if (!assertEqualWithUStringSearch(strsrch, *search)) {
1982 const SearchData *search = &(OVERLAPCANONICAL[count]);
1983 UCollator *collator = getCollator(search->collator);
1987 u_unescape(search->text, text, 128);
1988 u_unescape(search->pattern, pattern, 32);
2005 if (!assertEqualWithUStringSearch(strsrch, *search)) {
2009 search = &(NONOVERLAPCANONICAL[count]);
2016 if (!assertEqualWithUStringSearch(strsrch, *search)) {
2057 log_err("Error opening string search %s\n", u_errorName(status));
2123 log_err("Error opening string search %s\n", u_errorName(status));
2198 log_err("Error opening string search %s\n", u_errorName(status));
2299 SearchData search = BASICCANONICAL[searchDataIndex ++];
2300 int32_t matchindex = search.offset[count];
2308 u_unescape(search.text, text, 128);
2309 u_unescape(search.pattern, pattern, 32);
2314 uint32_t matchlength = search.size[count];
2328 matchindex = search.offset[count + 1] == -1 ? -1 :
2329 search.offset[count + 2];
2330 if (search.offset[count + 1] != -1) {
2331 usearch_setOffset(strsrch, search.offset[count + 1] + 1,
2333 if (usearch_getOffset(strsrch) != search.offset[count + 1] + 1) {
2406 log_err("Error opening string search %s\n", u_errorName(status));
2445 log_err("Expected U_UNSUPPORTED_ERROR when trying to instantiate a search object from a CODAN collator, got %s instead\n", u_errorName(status));
2459 UStringSearch *search = NULL;
2476 search = usearch_openFromCollator(value, 2, usrcstr, 22, coll, NULL, &status);
2482 usearch_reset(search);
2483 /* forward search */
2484 pos = usearch_first(search, &status);
2486 log_err("Expected search result: %d; Got instead: %d\n", expectedPos, pos);
2491 usearch_reset(search);
2492 /* backward search */
2493 pos = usearch_last(search, &status);
2495 log_err("Expected search result: %d; Got instead: %d\n", expectedPos, pos);
2502 if (search != NULL) {
2503 usearch_close(search);
2514 UStringSearch *search;
2566 /* open a search looking for 0 */
2567 search = usearch_openFromCollator(pattern, PATTERN_LEN, text,
2571 if (coll != NULL && search != NULL) {
2572 pos = usearch_first(search, &ec);
2573 len = usearch_getMatchedLength(search);
2575 log_err("Expected search result: %d; Got instead: %d\n", expectedPos,
2580 log_err("Expected search result length: %d; Got instead: %d\n",
2584 for (pos = usearch_first(search, &ec); pos != USEARCH_DONE; pos
2585 = usearch_next(search, &ec)) {
2591 log_err("Expected %d search hits, found %d\n", expectedNum, count);
2596 usearch_close(search);
2603 UStringSearch *search;
2623 /* open a search looking for 0 */
2624 search = usearch_openFromCollator (pattern, pLen, text, tLen, coll, NULL, &ec);
2627 if (coll != NULL && search != NULL) {
2628 pos = usearch_first(search, &ec);
2629 len = usearch_getMatchedLength(search);
2632 log_err("Expected search result: %d; Got instead: %d\n", expectedPos, pos);
2636 log_err("Expected search result length: %d; Got instead: %d\n", expectedLen, len);
2641 usearch_reset(search);
2643 pos = usearch_first(search, &ec);
2644 len = usearch_getMatchedLength(search);
2651 usearch_close(search);
2671 /*05*/ 0xAC0F, 0x0020, /* LVTT, last jamo expands for search */
2672 /*07*/ 0xAFFF, 0x0020, /* LLVVVTT, every jamo expands for search */
2674 /*13*/ 0x1100, 0x1161, 0x1100, 0x0020, /* 0xAC01 as basic conjoining jamo (per search rules) */
2676 /*21*/ 0x1100, 0x1161, 0x11B6, 0x0020, /* 0xAC0F as conjoining jamo; last expands for search */
2677 /*25*/ 0x1100, 0x1161, 0x1105, 0x1112, 0x0020, /* 0xAC0F as basic conjoining jamo; last expands for search */
2678 /*30*/ 0x1101, 0x1170, 0x11B6, 0x0020, /* 0xAFFF as conjoining jamo; all expand for search */
2728 { "root@collation=search", scKoText, scKoSrchPatternsOffsets },
2729 { "ko@collation=search", scKoText, scKoSrchPatternsOffsets },
2819 static void TestPCEBuffer_with(const UChar *search, uint32_t searchLen, const UChar *source, uint32_t sourceLen) {
2860 usearch = usearch_openFromCollator( search,
2897 UChar search[] =
2901 uint32_t searchLen = sizeof(search)/sizeof(UChar);
2903 TestPCEBuffer_with(search,searchLen,source,sourceLen);
2908 UChar search[] =
2912 uint32_t searchLen = sizeof(search)/sizeof(UChar);
2914 TestPCEBuffer_with(search,searchLen,source,sourceLen);
2919 UChar search[] = { 0x00c9 };
2932 searchLen = sizeof(search)/sizeof(UChar);
2959 usearch = usearch_openFromCollator(search,