]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/test/intltest/trnserr.cpp
ICU-8.11.tar.gz
[apple/icu.git] / icuSources / test / intltest / trnserr.cpp
index 46155390103327464c688b981bb6d4fe7a5e4b07..0b76616672fadbace88ec8781f81216eb37b1d1d 100644 (file)
@@ -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 */