From d96fea9eb606f26c668918a376e7ea31b93006f2 Mon Sep 17 00:00:00 2001 From: Andy Heninger Date: Thu, 26 Feb 2015 02:34:20 +0000 Subject: [PATCH] ICU-11123 promote RegexMatcher::find(UErrorCode &) to public API X-SVN-Rev: 37073 --- icu4c/source/i18n/unicode/regex.h | 2 +- icu4c/source/test/intltest/regextst.cpp | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/icu4c/source/i18n/unicode/regex.h b/icu4c/source/i18n/unicode/regex.h index 90478e461fa..c3c6441b6f8 100644 --- a/icu4c/source/i18n/unicode/regex.h +++ b/icu4c/source/i18n/unicode/regex.h @@ -849,7 +849,7 @@ public: * position may not be valid with the altered input string.

* @param status A reference to a UErrorCode to receive any errors. * @return TRUE if a match is found. - * @internal + * @draft ICU 55 */ virtual UBool find(UErrorCode &status); diff --git a/icu4c/source/test/intltest/regextst.cpp b/icu4c/source/test/intltest/regextst.cpp index b3ad8ccdfbe..c488e0e25db 100644 --- a/icu4c/source/test/intltest/regextst.cpp +++ b/icu4c/source/test/intltest/regextst.cpp @@ -4879,6 +4879,15 @@ void RegexTest::Callbacks() { REGEX_ASSERT(matcher.matches(status)==FALSE); REGEX_ASSERT(status == U_REGEX_STOPPED_BY_CALLER); REGEX_ASSERT(cbInfo.numCalls == 4); + + // A longer running find that the callback function will abort. + status = U_ZERO_ERROR; + cbInfo.reset(4); + s = "aaaaaaaaaaaaaaaaaaaaaaab"; + matcher.reset(s); + REGEX_ASSERT(matcher.find(status)==FALSE); + REGEX_ASSERT(status == U_REGEX_STOPPED_BY_CALLER); + REGEX_ASSERT(cbInfo.numCalls == 4); }