mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-14 17:24:01 +00:00
ICU-21388 Remove test case that does nothing so that we can mark RuleBasedCollator as final.
This commit is contained in:
parent
0a99ef6737
commit
8f787b6de9
3 changed files with 1 additions and 98 deletions
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue