From 8f787b6de9a7f964ada0c6988f2db899cb328a9b Mon Sep 17 00:00:00 2001 From: Jeff Genovy <29107334+jefgen@users.noreply.github.com> Date: Tue, 17 Nov 2020 14:09:06 -0800 Subject: [PATCH] ICU-21388 Remove test case that does nothing so that we can mark RuleBasedCollator as final. --- icu4c/source/i18n/unicode/tblcoll.h | 2 +- icu4c/source/test/intltest/regcoll.cpp | 91 -------------------------- icu4c/source/test/intltest/regcoll.h | 6 -- 3 files changed, 1 insertion(+), 98 deletions(-) diff --git a/icu4c/source/i18n/unicode/tblcoll.h b/icu4c/source/i18n/unicode/tblcoll.h index a004dd6644c..1709e836dd4 100644 --- a/icu4c/source/i18n/unicode/tblcoll.h +++ b/icu4c/source/i18n/unicode/tblcoll.h @@ -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 diff --git a/icu4c/source/test/intltest/regcoll.cpp b/icu4c/source/test/intltest/regcoll.cpp index 67c95a6a8c2..f103915f7c3 100644 --- a/icu4c/source/test/intltest/regcoll.cpp +++ b/icu4c/source/test/intltest/regcoll.cpp @@ -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); diff --git a/icu4c/source/test/intltest/regcoll.h b/icu4c/source/test/intltest/regcoll.h index 424acb2b7b1..3cc3e5e6a6a 100644 --- a/icu4c/source/test/intltest/regcoll.h +++ b/icu4c/source/test/intltest/regcoll.h @@ -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(); -- 2.40.0