]> granicus.if.org Git - icu/commitdiff
ICU-21388 Remove test case that does nothing so that we can mark RuleBasedCollator...
authorJeff Genovy <29107334+jefgen@users.noreply.github.com>
Tue, 17 Nov 2020 22:09:06 +0000 (14:09 -0800)
committerJeff Genovy <29107334+jefgen@users.noreply.github.com>
Fri, 4 Dec 2020 23:47:40 +0000 (15:47 -0800)
icu4c/source/i18n/unicode/tblcoll.h
icu4c/source/test/intltest/regcoll.cpp
icu4c/source/test/intltest/regcoll.h

index a004dd6644c394ed9622153f81fc2258ef81b3b5..1709e836dd4e98621fbbad2a57e83c751d2685db 100644 (file)
@@ -112,7 +112,7 @@ class UVector64;
  * Note, RuleBasedCollator is not to be subclassed.
  * @see        Collator
  */
-class U_I18N_API RuleBasedCollator : public Collator {
+class U_I18N_API RuleBasedCollator U_FINAL : public Collator {
 public:
     /**
      * RuleBasedCollator constructor. This takes the table rules and builds a
index 67c95a6a8c2342a1d0db5ca5ceecce3fdbeb9568..f103915f7c319ed3c78b96885d560e60b4d0ae6d 100644 (file)
@@ -984,96 +984,6 @@ void CollationRegressionTest::Test4139572(/* char* par */)
 
     delete col;
 }
-/* HSYS : RuleBasedCollator::compare() performance enhancements
-          compare() does not create CollationElementIterator() anymore.*/
-
-class My4146160Collator : public RuleBasedCollator
-{
-public:
-    My4146160Collator(RuleBasedCollator &rbc, UErrorCode &status);
-    ~My4146160Collator();
-
-    CollationElementIterator *createCollationElementIterator(const UnicodeString &text) const;
-
-    CollationElementIterator *createCollationElementIterator(const CharacterIterator &text) const;
-
-    static int32_t count;
-};
-
-int32_t My4146160Collator::count = 0;
-
-My4146160Collator::My4146160Collator(RuleBasedCollator &rbc, UErrorCode &status)
-  : RuleBasedCollator(rbc.getRules(), status)
-{
-}
-
-My4146160Collator::~My4146160Collator()
-{
-}
-
-CollationElementIterator *My4146160Collator::createCollationElementIterator(const UnicodeString &text) const
-{
-    count += 1;
-    return RuleBasedCollator::createCollationElementIterator(text);
-}
-
-CollationElementIterator *My4146160Collator::createCollationElementIterator(const CharacterIterator &text) const
-{
-    count += 1;
-    return RuleBasedCollator::createCollationElementIterator(text);
-}
-
-// @bug 4146160
-//
-// RuleBasedCollator doesn't use createCollationElementIterator internally
-//
-void CollationRegressionTest::Test4146160(/* char* par */)
-{
-#if 0
-    //
-    // Use a custom collator class whose createCollationElementIterator
-    // methods increment a count....
-    //
-    UErrorCode status = U_ZERO_ERROR;
-    CollationKey key;
-
-    My4146160Collator::count = 0;
-    My4146160Collator *mc = NULL;
-
-    mc = new My4146160Collator(*en_us, status);
-
-    if (mc == NULL || U_FAILURE(status))
-    {
-        errln("Failed to create a My4146160Collator.");
-        delete mc;
-        return;
-    }
-
-    mc->getCollationKey("1", key, status);
-
-    if (key.isBogus() || U_FAILURE(status))
-    {
-        errln("Failure to get a CollationKey from a My4146160Collator.");
-        delete mc;
-        return;
-    }
-
-    if (My4146160Collator::count < 1)
-    {
-        errln("My4146160Collator::createCollationElementIterator not called for getCollationKey");
-    }
-
-    My4146160Collator::count = 0;
-    mc->compare("1", "2");
-
-    if (My4146160Collator::count < 1)
-    {
-        errln("My4146160Collator::createtCollationElementIterator not called for compare");
-    }
-
-    delete mc;
-#endif
-}
 
 void CollationRegressionTest::Test4179216() {
     // you can position a CollationElementIterator in the middle of
@@ -1472,7 +1382,6 @@ void CollationRegressionTest::runIndexedTest(int32_t index, UBool exec, const ch
     TESTCASE_AUTO(Test4133509);
     TESTCASE_AUTO(Test4139572);
     TESTCASE_AUTO(Test4141640);
-    TESTCASE_AUTO(Test4146160);
     TESTCASE_AUTO(Test4179216);
     TESTCASE_AUTO(TestT7189);
     TESTCASE_AUTO(TestCaseFirstCompression);
index 424acb2b7b1cf0300dc152d1ecbf86c664365194..3cc3e5e6a6ae085b64f1a368a98fb5af0ecaea3f 100644 (file)
@@ -219,12 +219,6 @@ public:
     // Support for Swedish gone in 1.1.6 (Can't create Swedish collator) 
     //
     void Test4141640(/* char* par */);
-    
-    // @bug 4146160
-    //
-    // RuleBasedCollator doesn't use getCollationElementIterator internally
-    //
-    void Test4146160(/* char* par */);
 
     void Test4179216();