OLD | NEW |
(Empty) | |
| 1 Index: /icu/trunk/source/i18n/filteredbrk.cpp |
| 2 =================================================================== |
| 3 --- /icu/trunk/source/i18n/filteredbrk.cpp (revision 36671) |
| 4 +++ /icu/trunk/source/i18n/filteredbrk.cpp (revision 36672) |
| 5 @@ -148,5 +148,5 @@ |
| 6 virtual BreakIterator* clone(void) const { return new SimpleFilteredSentenceB
reakIterator(*this); } |
| 7 virtual UClassID getDynamicClassID(void) const { return NULL; } |
| 8 - virtual UBool operator==(const BreakIterator& o) const { if(*this==o) return
true; return false; } |
| 9 + virtual UBool operator==(const BreakIterator& o) const { if(this==&o) return
true; return false; } |
| 10 |
| 11 /* -- text modifying -- */ |
| 12 Index: /icu/trunk/source/test/intltest/rbbiapts.cpp |
| 13 =================================================================== |
| 14 --- /icu/trunk/source/test/intltest/rbbiapts.cpp (revision 36671) |
| 15 +++ /icu/trunk/source/test/intltest/rbbiapts.cpp (revision 36672) |
| 16 @@ -1227,4 +1227,5 @@ |
| 17 LocalPointer<BreakIterator> baseBI; |
| 18 LocalPointer<BreakIterator> filteredBI; |
| 19 + LocalPointer<BreakIterator> frenchBI; |
| 20 |
| 21 const UnicodeString text("In the meantime Mr. Weston arrived with his small s
hip, which he had now recovered. Capt. Gorges, who informed the Sgt. here that o
ne 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."); // (Willi
am Bradford, public domain. http://catalog.hathitrust.org/Record/008651224 ) - e
dited. |
| 22 @@ -1241,9 +1242,9 @@ |
| 23 TEST_ASSERT_SUCCESS(status); |
| 24 |
| 25 - logln("Building new BI\n"); |
| 26 + logln("Building new BI\n"); |
| 27 filteredBI.adoptInstead(builder->build(baseBI.orphan(), status)); |
| 28 TEST_ASSERT_SUCCESS(status); |
| 29 |
| 30 - if (U_SUCCESS(status)) { |
| 31 + if (U_SUCCESS(status)) { |
| 32 logln("Testing:"); |
| 33 filteredBI->setText(text); |
| 34 @@ -1375,5 +1376,4 @@ |
| 35 } |
| 36 |
| 37 -#if 0 |
| 38 // reenable once french is in |
| 39 { |
| 40 @@ -1387,17 +1387,31 @@ |
| 41 |
| 42 logln("Building new BI\n"); |
| 43 - filteredBI.adoptInstead(builder->build(baseBI.orphan(), status)); |
| 44 - TEST_ASSERT_SUCCESS(status); |
| 45 - |
| 46 - if(filteredBI.isValid()) { |
| 47 + frenchBI.adoptInstead(builder->build(baseBI.orphan(), status)); |
| 48 + TEST_ASSERT_SUCCESS(status); |
| 49 + |
| 50 + if(frenchBI.isValid()) { |
| 51 logln("Testing:"); |
| 52 - filteredBI->setText(text); |
| 53 - TEST_ASSERT(20 == filteredBI->next()); |
| 54 - TEST_ASSERT(84 == filteredBI->next()); |
| 55 + UnicodeString frText("C'est MM. Duval."); |
| 56 + frenchBI->setText(frText); |
| 57 + TEST_ASSERT(16 == frenchBI->next()); |
| 58 + TEST_ASSERT(BreakIterator::DONE == frenchBI->next()); |
| 59 + frenchBI->first(); |
| 60 + prtbrks(frenchBI.getAlias(), frText, *this); |
| 61 + logln("Testing against English:"); |
| 62 + filteredBI->setText(frText); |
| 63 + TEST_ASSERT(10 == filteredBI->next()); // wrong for french, but filterBI
is english. |
| 64 + TEST_ASSERT(16 == filteredBI->next()); |
| 65 + TEST_ASSERT(BreakIterator::DONE == filteredBI->next()); |
| 66 filteredBI->first(); |
| 67 - prtbrks(filteredBI.getAlias(), text, *this); |
| 68 - } |
| 69 + prtbrks(filteredBI.getAlias(), frText, *this); |
| 70 + |
| 71 + // Verify == |
| 72 + TEST_ASSERT_TRUE(*frenchBI == *frenchBI); |
| 73 + TEST_ASSERT_TRUE(*filteredBI != *frenchBI); |
| 74 + TEST_ASSERT_TRUE(*frenchBI != *filteredBI); |
| 75 + } else { |
| 76 + dataerrln("French BI: not valid."); |
| 77 + } |
| 78 } |
| 79 -#endif |
| 80 |
| 81 #else |
OLD | NEW |