+static void TestNumeric(void) {
+ UCollator *coll = NULL;
+ UStringSearch *strsrch = NULL;
+ UErrorCode status = U_ZERO_ERROR;
+
+ UChar pattern[128];
+ UChar text[128];
+ memset(pattern, 0, 128*sizeof(UChar));
+ memset(text, 0, 128*sizeof(UChar));
+
+ coll = ucol_open("", &status);
+ if(U_FAILURE(status)) {
+ log_data_err("Could not open UCA. Is your data around?\n");
+ return;
+ }
+
+ ucol_setAttribute(coll, UCOL_NUMERIC_COLLATION, UCOL_ON, &status);
+
+ strsrch = usearch_openFromCollator(pattern, 1, text, 1, coll, NULL, &status);
+
+ if(status != U_UNSUPPORTED_ERROR || U_SUCCESS(status)) {
+ log_err("Expected U_UNSUPPORTED_ERROR when trying to instantiate a search object from a CODAN collator, got %s instead\n", u_errorName(status));
+ if(strsrch) {
+ usearch_close(strsrch);
+ }
+ }
+
+ ucol_close(coll);
+
+}
+
+/* This test is for ticket 4038 due to incorrect backward searching when certain patterns have a length > 1 */
+static void TestForwardBackward(void) {
+ UErrorCode status = U_ZERO_ERROR;
+ UCollator *coll = NULL;
+ UStringSearch *search = NULL;
+ UChar usrcstr[32], value[4];
+ int32_t pos= -1;
+ int32_t expectedPos = 9;
+
+ coll = ucol_open("en_GB", &status);
+ if (U_FAILURE(status)) {
+ log_err_status(status, "ucol_open failed: %s\n", u_errorName(status));
+ goto exitTestForwardBackward;
+ }
+ ucol_setAttribute(coll, UCOL_STRENGTH, UCOL_PRIMARY, &status);
+ ucol_setAttribute(coll, UCOL_CASE_LEVEL, UCOL_ON, &status);
+ ucol_setAttribute(coll, UCOL_ALTERNATE_HANDLING, UCOL_NON_IGNORABLE, &status);
+
+ u_uastrcpy(usrcstr, "QBitArray::bitarr_data"); /* text */
+ u_uastrcpy(value, "::"); /* pattern */
+
+ search = usearch_openFromCollator(value, 2, usrcstr, 22, coll, NULL, &status);
+ if (U_FAILURE(status)) {
+ log_err("usearch_openFromCollator failed: %s\n", u_errorName(status));
+ goto exitTestForwardBackward;
+ }
+
+ usearch_reset(search);
+ /* forward search */
+ pos = usearch_first(search, &status);
+ if (pos != expectedPos) {
+ log_err("Expected search result: %d; Got instead: %d\n", expectedPos, pos);
+ goto exitTestForwardBackward;
+ }
+
+ pos = -1;
+ usearch_reset(search);
+ /* backward search */
+ pos = usearch_last(search, &status);
+ if (pos != expectedPos) {
+ log_err("Expected search result: %d; Got instead: %d\n", expectedPos, pos);
+ }
+
+exitTestForwardBackward :
+ if (coll != NULL) {
+ ucol_close(coll);
+ }
+ if (search != NULL) {
+ usearch_close(search);
+ }
+}
+
+#define TEST_ASSERT(x) \
+ {if (U_FAILURE(x)) {log_err_status(x, "%s:%d: FAIL: test assertion failure \n", __FILE__, __LINE__);\
+ }}
+
+static void TestSearchForNull(void) {
+ UCollator *coll;
+ UErrorCode ec;
+ UStringSearch *search;
+ int pos;
+ int len;
+ int expectedPos;
+ int expectedLen;
+ int expectedNum;
+ int count = 0;
+ const UChar zerodigit = 0x0030; /* 0 */
+ const UChar nulldigit = 0x0000; /* null */
+
+ /* static const UChar var[(length)+1]=U_DECLARE_UTF16(cs) */
+#define PATTERN_LEN 4
+#define TEXT_LEN 10
+
+ U_STRING_DECL(_pattern, "IS 0", PATTERN_LEN);
+ U_STRING_DECL(_text, "_0IS 0 OK?", TEXT_LEN);
+ UChar pattern[PATTERN_LEN + 1], text[TEXT_LEN + 1];
+
+ U_STRING_INIT(_pattern, "IS 0", PATTERN_LEN);
+ U_STRING_INIT(_text, "_0IS 0 OK?", TEXT_LEN);
+ expectedPos = 2;
+ expectedLen = 4;
+ expectedNum = 1;
+
+ for (pos = 0; pos < PATTERN_LEN; pos++) {
+ if (_pattern[pos] == zerodigit) {
+ pattern[pos] = nulldigit;
+ } else {
+ pattern[pos] = _pattern[pos];
+ }
+ }
+ pattern[PATTERN_LEN] = 0x0000;
+
+ for (pos = 0; pos < TEXT_LEN; pos++) {
+ if (_text[pos] == zerodigit) {
+ text[pos] = nulldigit;
+ } else {
+ text[pos] = _text[pos];
+ }
+ }
+ text[TEXT_LEN] = 0x0000;
+
+ ec = U_ZERO_ERROR;
+
+ /* create a US-English collator */
+ coll = ucol_open("en_US", &ec);
+
+ /* make sure we didn't fail. */
+ TEST_ASSERT (ec);
+
+ ucol_setStrength(coll, UCOL_IDENTICAL);
+
+ /* open a search looking for 0 */
+ search = usearch_openFromCollator(pattern, PATTERN_LEN, text,
+ TEXT_LEN, coll, NULL, &ec);
+ TEST_ASSERT (ec);
+
+ if (coll != NULL && search != NULL) {
+ pos = usearch_first(search, &ec);
+ len = usearch_getMatchedLength(search);
+ if (pos != expectedPos) {
+ log_err("Expected search result: %d; Got instead: %d\n", expectedPos,
+ pos);
+ }
+
+ if (len != expectedLen) {
+ log_err("Expected search result length: %d; Got instead: %d\n",
+ expectedLen, len);
+ }
+
+ for (pos = usearch_first(search, &ec); pos != USEARCH_DONE; pos
+ = usearch_next(search, &ec)) {
+ log_verbose("Match at %d\n", pos);
+ count += 1;
+ }
+
+ if (count != expectedNum) {
+ log_err("Expected %d search hits, found %d\n", expectedNum, count);
+ }
+ }
+
+ ucol_close(coll);
+ usearch_close(search);
+}
+
+static void TestStrengthIdentical(void)
+{
+ UCollator *coll;
+ UErrorCode ec = U_ZERO_ERROR;
+ UStringSearch *search;
+
+ UChar pattern[] = {0x05E9, 0x0591, 0x05E9};
+ UChar text[] = {0x05E9, 0x0592, 0x05E9};
+ int32_t pLen = sizeof (pattern) / sizeof(pattern[0]);
+ int32_t tLen = sizeof(text) / sizeof (text[0]);
+ int32_t expectedPos = 0;
+ int32_t expectedLen = 3;
+
+ int32_t pos;
+ int32_t len;
+
+ /* create a US-English collator */
+ coll = ucol_open ("en_US", &ec);
+
+ /* make sure we didn't fail. */
+ TEST_ASSERT (ec);
+
+ ucol_setStrength( coll, UCOL_TERTIARY);
+
+ /* open a search looking for 0 */
+ search = usearch_openFromCollator (pattern, pLen, text, tLen, coll, NULL, &ec);
+ TEST_ASSERT (ec);
+
+ if (coll != NULL && search != NULL) {
+ pos = usearch_first(search, &ec);
+ len = usearch_getMatchedLength(search);
+
+ if(pos != expectedPos) {
+ log_err("Expected search result: %d; Got instead: %d\n", expectedPos, pos);
+ }
+
+ if(len != expectedLen) {
+ log_err("Expected search result length: %d; Got instead: %d\n", expectedLen, len);
+ }
+
+ /* Now try it at strength == UCOL_IDENTICAL */
+ ucol_setStrength(coll, UCOL_IDENTICAL);
+ usearch_reset(search);
+
+ pos = usearch_first(search, &ec);
+ len = usearch_getMatchedLength(search);
+
+ if(pos != -1) {
+ log_err("Expected failure for strentgh = UCOL_IDENTICAL: got %d instead.\n", pos);
+ }
+ }
+
+ usearch_close(search);
+ ucol_close(coll);
+}
+
+/**
+* TestUsingSearchCollator
+*/
+
+#define ARRAY_LENGTH(array) (sizeof(array)/sizeof(array[0]))
+
+typedef struct {
+ const UChar * pattern;
+ const int32_t * offsets;
+ int32_t offsetsLen;
+} PatternAndOffsets;
+
+static const UChar scKoText[] = {
+ 0x0020,
+/*01*/ 0xAC00, 0x0020, /* simple LV Hangul */
+/*03*/ 0xAC01, 0x0020, /* simple LVT Hangul */
+/*05*/ 0xAC0F, 0x0020, /* LVTT, last jamo expands for search */
+/*07*/ 0xAFFF, 0x0020, /* LLVVVTT, every jamo expands for search */
+/*09*/ 0x1100, 0x1161, 0x11A8, 0x0020, /* 0xAC01 as conjoining jamo */
+/*13*/ 0x1100, 0x1161, 0x1100, 0x0020, /* 0xAC01 as basic conjoining jamo (per search rules) */
+/*17*/ 0x3131, 0x314F, 0x3131, 0x0020, /* 0xAC01 as compatibility jamo */
+/*21*/ 0x1100, 0x1161, 0x11B6, 0x0020, /* 0xAC0F as conjoining jamo; last expands for search */
+/*25*/ 0x1100, 0x1161, 0x1105, 0x1112, 0x0020, /* 0xAC0F as basic conjoining jamo; last expands for search */
+/*30*/ 0x1101, 0x1170, 0x11B6, 0x0020, /* 0xAFFF as conjoining jamo; all expand for search */
+/*34*/ 0x00E6, 0x0020, /* small letter ae, expands */
+/*36*/ 0x1E4D, 0x0020, /* small letter o with tilde and acute, decomposes */
+ 0
+};
+
+static const UChar scKoPat0[] = { 0xAC01, 0 };
+static const UChar scKoPat1[] = { 0x1100, 0x1161, 0x11A8, 0 }; /* 0xAC01 as conjoining jamo */
+static const UChar scKoPat2[] = { 0xAC0F, 0 };
+static const UChar scKoPat3[] = { 0x1100, 0x1161, 0x1105, 0x1112, 0 }; /* 0xAC0F as basic conjoining jamo */
+static const UChar scKoPat4[] = { 0xAFFF, 0 };
+static const UChar scKoPat5[] = { 0x1101, 0x1170, 0x11B6, 0 }; /* 0xAFFF as conjoining jamo */
+
+static const int32_t scKoSrchOff01[] = { 3, 9, 13 };
+static const int32_t scKoSrchOff23[] = { 5, 21, 25 };
+static const int32_t scKoSrchOff45[] = { 7, 30 };
+
+static const PatternAndOffsets scKoSrchPatternsOffsets[] = {
+ { scKoPat0, scKoSrchOff01, ARRAY_LENGTH(scKoSrchOff01) },
+ { scKoPat1, scKoSrchOff01, ARRAY_LENGTH(scKoSrchOff01) },
+ { scKoPat2, scKoSrchOff23, ARRAY_LENGTH(scKoSrchOff23) },
+ { scKoPat3, scKoSrchOff23, ARRAY_LENGTH(scKoSrchOff23) },
+ { scKoPat4, scKoSrchOff45, ARRAY_LENGTH(scKoSrchOff45) },
+ { scKoPat5, scKoSrchOff45, ARRAY_LENGTH(scKoSrchOff45) },
+ { NULL, NULL, 0 }
+};
+
+static const int32_t scKoStndOff01[] = { 3, 9 };
+static const int32_t scKoStndOff2[] = { 5, 21 };
+static const int32_t scKoStndOff3[] = { 25 };
+static const int32_t scKoStndOff45[] = { 7, 30 };
+
+static const PatternAndOffsets scKoStndPatternsOffsets[] = {
+ { scKoPat0, scKoStndOff01, ARRAY_LENGTH(scKoStndOff01) },
+ { scKoPat1, scKoStndOff01, ARRAY_LENGTH(scKoStndOff01) },
+ { scKoPat2, scKoStndOff2, ARRAY_LENGTH(scKoStndOff2) },
+ { scKoPat3, scKoStndOff3, ARRAY_LENGTH(scKoStndOff3) },
+ { scKoPat4, scKoStndOff45, ARRAY_LENGTH(scKoStndOff45) },
+ { scKoPat5, scKoStndOff45, ARRAY_LENGTH(scKoStndOff45) },
+ { NULL, NULL, 0 }
+};
+
+typedef struct {
+ const char * locale;
+ const UChar * text;
+ const PatternAndOffsets * patternsAndOffsets;
+} TUSCItem;
+
+static const TUSCItem tuscItems[] = {
+ { "root", scKoText, scKoStndPatternsOffsets },
+ { "root@collation=search", scKoText, scKoSrchPatternsOffsets },
+ { "ko@collation=search", scKoText, scKoSrchPatternsOffsets },
+ { NULL, NULL, NULL }
+};
+
+static const UChar dummyPat[] = { 0x0061, 0 };
+
+static void TestUsingSearchCollator(void)
+{
+ const TUSCItem * tuscItemPtr;
+ for (tuscItemPtr = tuscItems; tuscItemPtr->locale != NULL; tuscItemPtr++) {
+ UErrorCode status = U_ZERO_ERROR;
+ UCollator* ucol = ucol_open(tuscItemPtr->locale, &status);
+ if ( U_SUCCESS(status) ) {
+ UStringSearch* usrch = usearch_openFromCollator(dummyPat, -1, tuscItemPtr->text, -1, ucol, NULL, &status);
+ if ( U_SUCCESS(status) ) {
+ const PatternAndOffsets * patternsOffsetsPtr;
+ for ( patternsOffsetsPtr = tuscItemPtr->patternsAndOffsets; patternsOffsetsPtr->pattern != NULL; patternsOffsetsPtr++) {
+ usearch_setPattern(usrch, patternsOffsetsPtr->pattern, -1, &status);
+ if ( U_SUCCESS(status) ) {
+ int32_t offset;
+ const int32_t * nextOffsetPtr;
+ const int32_t * limitOffsetPtr;
+
+ usearch_reset(usrch);
+ nextOffsetPtr = patternsOffsetsPtr->offsets;
+ limitOffsetPtr = patternsOffsetsPtr->offsets + patternsOffsetsPtr->offsetsLen;
+ while (TRUE) {
+ offset = usearch_next(usrch, &status);
+ if ( U_FAILURE(status) || offset == USEARCH_DONE ) {
+ break;
+ }
+ if ( nextOffsetPtr < limitOffsetPtr ) {
+ if (offset != *nextOffsetPtr) {
+ log_err("error, locale %s, expected usearch_next %d, got %d\n", tuscItemPtr->locale, *nextOffsetPtr, offset);
+ nextOffsetPtr = limitOffsetPtr;
+ break;
+ }
+ nextOffsetPtr++;
+ } else {
+ log_err("error, locale %s, usearch_next returned more matches than expected\n", tuscItemPtr->locale );
+ }
+ }
+ if ( U_FAILURE(status) ) {
+ log_err("error, locale %s, usearch_next failed: %s\n", tuscItemPtr->locale, u_errorName(status) );
+ } else if ( nextOffsetPtr < limitOffsetPtr ) {
+ log_err("error, locale %s, usearch_next returned fewer matches than expected\n", tuscItemPtr->locale );
+ }
+
+ status = U_ZERO_ERROR;
+ usearch_reset(usrch);
+ nextOffsetPtr = patternsOffsetsPtr->offsets + patternsOffsetsPtr->offsetsLen;
+ limitOffsetPtr = patternsOffsetsPtr->offsets;
+ while (TRUE) {
+ offset = usearch_previous(usrch, &status);
+ if ( U_FAILURE(status) || offset == USEARCH_DONE ) {
+ break;
+ }
+ if ( nextOffsetPtr > limitOffsetPtr ) {
+ nextOffsetPtr--;
+ if (offset != *nextOffsetPtr) {
+ log_err("error, locale %s, expected usearch_previous %d, got %d\n", tuscItemPtr->locale, *nextOffsetPtr, offset);
+ nextOffsetPtr = limitOffsetPtr;
+ break;
+ }
+ } else {
+ log_err("error, locale %s, usearch_previous returned more matches than expected\n", tuscItemPtr->locale );
+ }
+ }
+ if ( U_FAILURE(status) ) {
+ log_err("error, locale %s, usearch_previous failed: %s\n", tuscItemPtr->locale, u_errorName(status) );
+ } else if ( nextOffsetPtr > limitOffsetPtr ) {
+ log_err("error, locale %s, usearch_previous returned fewer matches than expected\n", tuscItemPtr->locale );
+ }
+
+ } else {
+ log_err("error, locale %s, usearch_setPattern failed: %s\n", tuscItemPtr->locale, u_errorName(status) );
+ }
+ }
+ usearch_close(usrch);
+ } else {
+ log_err("error, locale %s, usearch_openFromCollator failed: %s\n", tuscItemPtr->locale, u_errorName(status) );
+ }
+ ucol_close(ucol);
+ } else {
+ log_data_err("error, locale %s, ucol_open failed: %s\n", tuscItemPtr->locale, u_errorName(status) );
+ }
+ }
+}
+
+
+static void TestPCEBuffer_with(const UChar *search, uint32_t searchLen, const UChar *source, uint32_t sourceLen) {
+ UErrorCode icuStatus = U_ZERO_ERROR;
+ UCollator *coll;
+ const char *locale;
+ UBreakIterator *ubrk;
+ UStringSearch *usearch;
+ int32_t match = 0;
+
+
+ coll = ucol_openFromShortString( "LSK_AS_CX_EX_FX_HX_NX_S4",
+ FALSE,
+ NULL,
+ &icuStatus );
+ if ( U_FAILURE(icuStatus) )
+ {
+ log_data_err( "ucol_openFromShortString error %s\n" , u_errorName(icuStatus));
+ goto exit;
+ }
+
+ locale = ucol_getLocaleByType( coll,
+ ULOC_VALID_LOCALE,
+ &icuStatus );
+ if ( U_FAILURE(icuStatus) )
+ {
+ log_err( "ucol_getLocaleByType error %s\n", u_errorName(icuStatus) );
+ goto exit;
+ }
+
+ log_verbose("locale=%s\n", locale);
+
+ ubrk = ubrk_open( UBRK_CHARACTER,
+ locale,
+ source,
+ sourceLen,
+ &icuStatus );
+ if ( U_FAILURE(icuStatus) )
+ {
+ log_err( "ubrk_open error %s\n", u_errorName(icuStatus) );
+ goto exit;
+ }
+
+ usearch = usearch_openFromCollator( search,
+ searchLen,
+ source,
+ sourceLen,
+ coll,
+ ubrk,
+ &icuStatus );
+ if ( U_FAILURE(icuStatus) )
+ {
+ log_err( "usearch_openFromCollator error %s\n", u_errorName(icuStatus) );
+ goto exit;
+ }
+
+ match = usearch_first( usearch,
+ &icuStatus );
+ if ( U_FAILURE(icuStatus) )
+ {
+ log_err( "usearch_first error %s\n", u_errorName(icuStatus) );
+ goto exit;
+ }
+
+ if(match==0) {
+ log_verbose("OK: match=%d\n", match);
+ } else {
+ log_err("Err: match expected 0 got %d\n", match);
+ }
+
+ usearch_close(usearch);
+ ubrk_close(ubrk);
+ ucol_close(coll);
+
+exit:
+ return;
+}
+
+
+static void TestPCEBuffer_100df(void) {
+ UChar search[] =
+ { 0x0020, 0x0020, 0x00df, 0x0020, 0x0041, 0x00df, 0x0020, 0x0061, 0x00df, 0x0020, 0x00c5, 0x00df, 0x0020, 0x212b, 0x00df, 0x0020, 0x0041, 0x030a, 0x00df, 0x0020, 0x00e5, 0x00df, 0x0020, 0x0061, 0x02da, 0x00df, 0x0020, 0x0061, 0x030a, 0x00df, 0x0020, 0xd8fa, 0xdeae, 0x00df, 0x0020, 0x2027, 0x00df }; /* 38 cp, 9 of them unpaired surrogates */
+ UChar source[] =
+ { 0x0020, 0x0020, 0x00df, 0x0020, 0x0041, 0x00df, 0x0020, 0x0061, 0x00df, 0x0020, 0x00c5, 0x00df, 0x0020, 0x212b, 0x00df, 0x0020, 0x0041, 0x030a, 0x00df, 0x0020, 0x00e5, 0x00df, 0x0020, 0x0061, 0x02da, 0x00df, 0x0020, 0x0061, 0x030a, 0x00df, 0x0020, 0xd8fa, 0xdeae, 0x00df, 0x0020, 0x2027, 0x00df };
+ uint32_t searchLen = sizeof(search)/sizeof(UChar);
+ uint32_t sourceLen = sizeof(source)/sizeof(UChar);
+ TestPCEBuffer_with(search,searchLen,source,sourceLen);
+ }
+
+
+static void TestPCEBuffer_2surr(void) {
+ UChar search[] =
+ { 0x0020, 0x0020, 0xdfff, 0x0020, 0x0041, 0xdfff, 0x0020, 0x0061, 0xdfff, 0x0020, 0x00c5, 0xdfff, 0x0020, 0x212b, 0xdfff, 0x0020, 0x0041, 0x030a, 0xdfff, 0x0020, 0x00e5, 0xdfff, 0x0020, 0x0061, 0x02da, 0xdfff, 0x0020, 0x0061, 0x030a, 0xdfff, 0x0020, 0xd8fa, 0xdeae, 0xdfff, 0x0020, 0x2027, 0xdfff }; /* 38 cp, 9 of them unpaired surrogates */
+ UChar source[] =
+ { 0x0020, 0x0020, 0xdfff, 0x0020, 0x0041, 0xdfff, 0x0020, 0x0061, 0xdfff, 0x0020, 0x00c5, 0xdfff, 0x0020, 0x212b, 0xdfff, 0x0020, 0x0041, 0x030a, 0xdfff, 0x0020, 0x00e5, 0xdfff, 0x0020, 0x0061, 0x02da, 0xdfff, 0x0020, 0x0061, 0x030a, 0xdfff, 0x0020, 0xd8fa, 0xdeae, 0xdfff, 0x0020, 0x2027, 0xdfff };
+ uint32_t searchLen = sizeof(search)/sizeof(UChar);
+ uint32_t sourceLen = sizeof(source)/sizeof(UChar);
+ TestPCEBuffer_with(search,searchLen,source,sourceLen);
+}
+
+static void TestMatchFollowedByIgnorables(void) {
+ /* test case for ticket#8482 */
+ UChar search[] = { 0x00c9 };
+ UChar source[] = { 0x00c9, 0x0000, 0x0041 };
+ int32_t searchLen;
+ int32_t sourceLen;
+ UErrorCode icuStatus = U_ZERO_ERROR;
+ UCollator *coll;
+ const char *locale;
+ UBreakIterator *ubrk;
+ UStringSearch *usearch;
+ int32_t match = 0;
+ int32_t matchLength = 0;
+ const int32_t expectedMatchLength = 1;
+
+ searchLen = sizeof(search)/sizeof(UChar);
+ sourceLen = sizeof(source)/sizeof(UChar);
+
+ coll = ucol_openFromShortString("LHR_AN_CX_EX_FX_HX_NX_S3",
+ FALSE,
+ NULL,
+ &icuStatus);
+ if (U_FAILURE(icuStatus)) {
+ log_data_err("ucol_openFromShortString error - %s\n", u_errorName(icuStatus));
+ }
+
+ locale = ucol_getLocaleByType(coll,
+ ULOC_VALID_LOCALE,
+ &icuStatus);
+ if (U_FAILURE(icuStatus)) {
+ log_data_err("ucol_getLocaleByType error - %s\n", u_errorName(icuStatus));
+ }
+
+ ubrk = ubrk_open(UBRK_CHARACTER,
+ locale,
+ source,
+ sourceLen,
+ &icuStatus);
+ if (U_FAILURE(icuStatus)) {
+ log_data_err("ubrk_open error - %s\n", u_errorName(icuStatus));
+ }
+
+ usearch = usearch_openFromCollator(search,
+ searchLen,
+ source,
+ sourceLen,
+ coll,
+ ubrk,
+ &icuStatus);
+ if (U_FAILURE(icuStatus)) {
+ log_data_err("usearch_openFromCollator error - %s\n", u_errorName(icuStatus));
+ }
+
+ match = usearch_first(usearch,
+ &icuStatus);
+ if (U_FAILURE(icuStatus)) {
+ log_data_err("usearch_first error - %s\n", u_errorName(icuStatus));
+ } else {
+
+ log_verbose("match=%d\n", match);
+
+ matchLength = usearch_getMatchedLength(usearch);
+
+ if (matchLength != expectedMatchLength) {
+ log_err("Error: matchLength=%d, expected=%d\n", matchLength, expectedMatchLength);
+ }
+ }
+
+ usearch_close(usearch);
+ ubrk_close(ubrk);
+ ucol_close(coll);
+}
+
+/**
+* addSearchTest
+*/
+