Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(652)

Unified Diff: source/test/intltest/rbbiapts.cpp

Issue 1191653011: icu: Merge http://bugs.icu-project.org/trac/changeset/36672 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/icu.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/i18n/filteredbrk.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/test/intltest/rbbiapts.cpp
diff --git a/source/test/intltest/rbbiapts.cpp b/source/test/intltest/rbbiapts.cpp
index 622107e7f74f9477634714d13b468738eef839e9..56e2be45c48e57628e9b82a3a1c834b2793c30ac 100644
--- a/source/test/intltest/rbbiapts.cpp
+++ b/source/test/intltest/rbbiapts.cpp
@@ -1226,6 +1226,7 @@ void RBBIAPITest::TestFilteredBreakIteratorBuilder() {
LocalPointer<FilteredBreakIteratorBuilder> builder;
LocalPointer<BreakIterator> baseBI;
LocalPointer<BreakIterator> filteredBI;
+ LocalPointer<BreakIterator> frenchBI;
const UnicodeString text("In the meantime Mr. Weston arrived with his small ship, which he had now recovered. Capt. Gorges, who informed the Sgt. here that one purpose of his going east was to meet with Mr. Weston, took this opportunity to call him to account for some abuses he had to lay to his charge."); // (William Bradford, public domain. http://catalog.hathitrust.org/Record/008651224 ) - edited.
const UnicodeString ABBR_MR("Mr.");
@@ -1240,11 +1241,11 @@ void RBBIAPITest::TestFilteredBreakIteratorBuilder() {
baseBI.adoptInstead(BreakIterator::createSentenceInstance(Locale::getEnglish(), status));
TEST_ASSERT_SUCCESS(status);
- logln("Building new BI\n");
+ logln("Building new BI\n");
filteredBI.adoptInstead(builder->build(baseBI.orphan(), status));
TEST_ASSERT_SUCCESS(status);
- if (U_SUCCESS(status)) {
+ if (U_SUCCESS(status)) {
logln("Testing:");
filteredBI->setText(text);
TEST_ASSERT(20 == filteredBI->next()); // Mr.
@@ -1374,7 +1375,6 @@ void RBBIAPITest::TestFilteredBreakIteratorBuilder() {
}
}
-#if 0
// reenable once french is in
{
logln("Constructing French builder");
@@ -1386,19 +1386,33 @@ void RBBIAPITest::TestFilteredBreakIteratorBuilder() {
TEST_ASSERT_SUCCESS(status);
logln("Building new BI\n");
- filteredBI.adoptInstead(builder->build(baseBI.orphan(), status));
+ frenchBI.adoptInstead(builder->build(baseBI.orphan(), status));
TEST_ASSERT_SUCCESS(status);
- if(filteredBI.isValid()) {
+ if(frenchBI.isValid()) {
logln("Testing:");
- filteredBI->setText(text);
- TEST_ASSERT(20 == filteredBI->next());
- TEST_ASSERT(84 == filteredBI->next());
+ UnicodeString frText("C'est MM. Duval.");
+ frenchBI->setText(frText);
+ TEST_ASSERT(16 == frenchBI->next());
+ TEST_ASSERT(BreakIterator::DONE == frenchBI->next());
+ frenchBI->first();
+ prtbrks(frenchBI.getAlias(), frText, *this);
+ logln("Testing against English:");
+ filteredBI->setText(frText);
+ TEST_ASSERT(10 == filteredBI->next()); // wrong for french, but filterBI is english.
+ TEST_ASSERT(16 == filteredBI->next());
+ TEST_ASSERT(BreakIterator::DONE == filteredBI->next());
filteredBI->first();
- prtbrks(filteredBI.getAlias(), text, *this);
- }
+ prtbrks(filteredBI.getAlias(), frText, *this);
+
+ // Verify ==
+ TEST_ASSERT_TRUE(*frenchBI == *frenchBI);
+ TEST_ASSERT_TRUE(*filteredBI != *frenchBI);
+ TEST_ASSERT_TRUE(*frenchBI != *filteredBI);
+ } else {
+ dataerrln("French BI: not valid.");
+ }
}
-#endif
#else
logln("Skipped- not: !UCONFIG_NO_BREAK_ITERATION && U_HAVE_STD_STRING && !UCONFIG_NO_FILTERED_BREAK_ITERATION");
« no previous file with comments | « source/i18n/filteredbrk.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698