+ nextStart = strsrch->getText().length();
+
+ while (TRUE) {
+ strsrch->preceding(nextStart, status);
+
+ if (count < 0) {
+ if (strsrch->getMatchedStart() != USEARCH_DONE || strsrch->getMatchedLength() != 0) {
+ char *str = toCharString(strsrch->getText());
+ errln("Text: %s\n", str);
+ str = toCharString(strsrch->getPattern());
+ errln("Pattern: %s\n", str);
+ errln("Error preceding match starting at %d (overlap: %d) found at %d (len:%d); expected <NO MATCH>\n",
+ nextStart, isOverlap,
+ strsrch->getMatchedStart(),
+ strsrch->getMatchedLength());
+ return FALSE;
+ }
+ // no more matches
+ break;
+ }
+
+ matchindex = search->offset[count];
+ matchlength = search->size[count];
+ if (strsrch->getMatchedStart() != matchindex
+ || strsrch->getMatchedLength() != matchlength
+ || U_FAILURE(status)) {
+ char *str = toCharString(strsrch->getText());
+ errln("Text: %s\n", str);
+ str = toCharString(strsrch->getPattern());
+ errln("Pattern: %s\n", str);
+ errln("Error preceding match starting at %d (overlap: %d) found at %d (len:%d); expected %d (len:%d)\n",
+ nextStart, isOverlap,
+ strsrch->getMatchedStart(), strsrch->getMatchedLength(),
+ matchindex, matchlength);
+ return FALSE;
+ }
+
+ nextStart = matchindex;
+ count--;
+ }
+