X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/9d88c94317aeac5dd26c1dbe8c2112dbe855d2b5..73c04bcfe1096173b00431f0cdc742894b15eef0:/icuSources/test/intltest/trnserr.cpp diff --git a/icuSources/test/intltest/trnserr.cpp b/icuSources/test/intltest/trnserr.cpp index 46155390..0b766166 100644 --- a/icuSources/test/intltest/trnserr.cpp +++ b/icuSources/test/intltest/trnserr.cpp @@ -1,6 +1,6 @@ /******************************************************************** * COPYRIGHT: - * Copyright (c) 2001-2004, International Business Machines Corporation and + * Copyright (c) 2001-2005, International Business Machines Corporation and * others. All Rights Reserved. ********************************************************************/ /************************************************************************ @@ -43,6 +43,7 @@ TransliteratorErrorTest::runIndexedTest(int32_t index, UBool exec, TESTCASE(0,TestTransliteratorErrors); TESTCASE(1, TestUnicodeSetErrors); TESTCASE(2, TestRBTErrors); + TESTCASE(3, TestCoverage); //TESTCASE(3, TestUniToHexErrors); //TESTCASE(4, TestHexToUniErrors); // TODO: Add a subclass to test clone(). @@ -264,4 +265,25 @@ void TransliteratorErrorTest::TestRBTErrors() { // delete t; //} +class StubTransliterator: public Transliterator{ +public: + StubTransliterator(): Transliterator(UNICODE_STRING_SIMPLE("Any-Null"), 0) {} + virtual void handleTransliterate(Replaceable& ,UTransPosition& offsets,UBool) const { + offsets.start = offsets.limit; + } + + virtual UClassID getDynamicClassID() const{ + static char classID = 0; + return (UClassID)&classID; + } +}; + +void TransliteratorErrorTest::TestCoverage() { + StubTransliterator stub; + + if (stub.clone() != NULL){ + errln("FAIL: default Transliterator::clone() should return NULL"); + } +} + #endif /* #if !UCONFIG_NO_TRANSLITERATION */