]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/test/intltest/transtst.cpp
ICU-551.51.4.tar.gz
[apple/icu.git] / icuSources / test / intltest / transtst.cpp
index 556a07c7a47428045c402e405f02fe5da8a4aeec..33f54a7e93bf4072e5c4bddf1ecdf7c7bd643903 100644 (file)
@@ -1,6 +1,6 @@
 /*
 **********************************************************************
-*   Copyright (C) 1999-2008, International Business Machines
+*   Copyright (C) 1999-2014, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 **********************************************************************
 *   Date        Name        Description
@@ -23,6 +23,7 @@
 #include "unicode/ustring.h"
 #include "unicode/usetiter.h"
 #include "unicode/uscript.h"
+#include "unicode/utf16.h"
 #include "cpdtrans.h"
 #include "nultrans.h"
 #include "rbt.h"
@@ -171,7 +172,9 @@ TransliteratorTest::runIndexedTest(int32_t index, UBool exec,
         TESTCASE(62,TestAnchorMasking);
         TESTCASE(63,TestDisplayName);
         TESTCASE(64,TestSpecialCases);
+#if !UCONFIG_NO_FILE_IO
         TESTCASE(65,TestIncrementalProgress);
+#endif
         TESTCASE(66,TestSurrogateCasing);
         TESTCASE(67,TestFunction);
         TESTCASE(68,TestInvalidBackRef);
@@ -180,7 +183,7 @@ TransliteratorTest::runIndexedTest(int32_t index, UBool exec,
         TESTCASE(71,TestAnyX);
         TESTCASE(72,TestSourceTargetSet);
         TESTCASE(73,TestGurmukhiDevanagari);
-        TESTCASE(74,TestRuleWhitespace);
+        TESTCASE(74,TestPatternWhiteSpace);
         TESTCASE(75,TestAllCodepoints);
         TESTCASE(76,TestBoilerplate);
         TESTCASE(77,TestAlternateSyntax);
@@ -190,11 +193,11 @@ TransliteratorTest::runIndexedTest(int32_t index, UBool exec,
         TESTCASE(81,TestRuleStripping);
         TESTCASE(82,TestHalfwidthFullwidth);
         TESTCASE(83,TestThai);
+        TESTCASE(84,TestAny);
         default: name = ""; break;
     }
 }
 
-static const UVersionInfo ICU_39 = {3,9,4,0};
 /**
  * Make sure every system transliterator can be instantiated.
  * 
@@ -236,16 +239,20 @@ void TransliteratorTest::TestInstantiation() {
         name.truncate(0);
         Transliterator::getDisplayName(id, name);
         if (t == 0) {
-            errln(UnicodeString("FAIL: Couldn't create ") + id +
-                  /*", parse error " + parseError.code +*/
-                  ", line " + parseError.line +
-                  ", offset " + parseError.offset +
-                  ", pre-context " + prettify(parseError.preContext, TRUE) +
-                  ", post-context " +prettify(parseError.postContext,TRUE) +
-                  ", Error: " + u_errorName(status));
-            // When createInstance fails, it deletes the failing
-            // entry from the available ID list.  We detect this
-            // here by looking for a change in countAvailableIDs.
+#if UCONFIG_NO_BREAK_ITERATION
+            // If UCONFIG_NO_BREAK_ITERATION is on, then only Thai should fail.
+            if (id.compare((UnicodeString)"Thai-Latin") != 0)
+#endif
+                dataerrln(UnicodeString("FAIL: Couldn't create ") + id +
+                      /*", parse error " + parseError.code +*/
+                      ", line " + parseError.line +
+                      ", offset " + parseError.offset +
+                      ", pre-context " + prettify(parseError.preContext, TRUE) +
+                      ", post-context " +prettify(parseError.postContext,TRUE) +
+                      ", Error: " + u_errorName(status));
+                // When createInstance fails, it deletes the failing
+                // entry from the available ID list.  We detect this
+                // here by looking for a change in countAvailableIDs.
             int32_t nn = Transliterator::countAvailableIDs();
             if (nn == (n - 1)) {
                 n = nn;
@@ -340,7 +347,7 @@ void TransliteratorTest::TestSimpleRules(void) {
         UTRANS_FORWARD, parseError,
         status);
     if (U_FAILURE(status)) {
-        errln("FAIL: RBT constructor failed");
+        dataerrln("FAIL: RBT constructor failed - %s", u_errorName(status));
         return;
     }
     expect(*t, "abcdefgABCDEFGU", "&bcd&fg!^**!^*&");
@@ -599,7 +606,7 @@ void TransliteratorTest::TestCompoundKana(void) {
     UErrorCode status = U_ZERO_ERROR;
     Transliterator* t = Transliterator::createInstance("Latin-Hiragana;Hiragana-Latin", UTRANS_FORWARD, parseError, status);
     if (t == 0) {
-        errln("FAIL: construction of Latin-Hiragana;Hiragana-Latin failed");
+        dataerrln("FAIL: construction of Latin-Hiragana;Hiragana-Latin failed - %s", u_errorName(status));
     } else {
         expect(*t, "aaaaa", "aaaaa");
         delete t;
@@ -760,7 +767,7 @@ void TransliteratorTest::TestJ277(void) {
     UParseError parseError;
     Transliterator *gl = Transliterator::createInstance("Greek-Latin; NFD; [:M:]Remove; NFC", UTRANS_FORWARD, parseError, status);
     if (gl == NULL) {
-        errln("FAIL: createInstance(Greek-Latin) returned NULL");
+        dataerrln("FAIL: createInstance(Greek-Latin) returned NULL - %s", u_errorName(status));
         return;
     }
 
@@ -1073,7 +1080,7 @@ void TransliteratorTest::TestHiraganaKatakana(void) {
     Transliterator* hk = Transliterator::createInstance("Hiragana-Katakana", UTRANS_FORWARD, parseError, status);
     Transliterator* kh = Transliterator::createInstance("Katakana-Hiragana", UTRANS_FORWARD, parseError, status);
     if (hk == 0 || kh == 0) {
-        errln("FAIL: createInstance failed");
+        dataerrln("FAIL: createInstance failed - %s", u_errorName(status));
         delete hk;
         delete kh;
         return;
@@ -1147,7 +1154,7 @@ void TransliteratorTest::TestInterIndic(void) {
     UParseError parseError;
     Transliterator* dg = Transliterator::createInstance(ID, UTRANS_FORWARD, parseError, status);
     if (dg == 0) {
-        errln("FAIL: createInstance(" + ID + ") returned NULL");
+        dataerrln("FAIL: createInstance(" + ID + ") returned NULL - " + u_errorName(status));
         return;
     }
     UnicodeString id = dg->getID();
@@ -1269,8 +1276,8 @@ void TransliteratorTest::TestNameMap(void) {
 
     // Careful:  CharsToUS will convert "\\N" => "N"; use "\\\\N" for \N
     expect(*uni2name, CharsToUnicodeString("\\u00A0abc\\u4E01\\u00B5\\u0A81\\uFFFD\\u0004\\u0009\\u0081\\uFFFF"),
-           CharsToUnicodeString("\\\\N{NO-BREAK SPACE}abc\\\\N{CJK UNIFIED IDEOGRAPH-4E01}\\\\N{MICRO SIGN}\\\\N{GUJARATI SIGN CANDRABINDU}\\\\N{REPLACEMENT CHARACTER}\\\\N{END OF TRANSMISSION}\\\\N{CHARACTER TABULATION}\\\\N{<control-0081>}\\\\N{<noncharacter-FFFF>}"));
-    expect(*name2uni, UNICODE_STRING_SIMPLE("{\\N { NO-BREAK SPACE}abc\\N{  CJK UNIFIED  IDEOGRAPH-4E01  }\\N{x\\N{MICRO SIGN}\\N{GUJARATI SIGN CANDRABINDU}\\N{REPLACEMENT CHARACTER}\\N{END OF TRANSMISSION}\\N{CHARACTER TABULATION}\\N{<control-0081>}\\N{<noncharacter-FFFF>}\\N{<control-0004>}\\N{"),
+           CharsToUnicodeString("\\\\N{NO-BREAK SPACE}abc\\\\N{CJK UNIFIED IDEOGRAPH-4E01}\\\\N{MICRO SIGN}\\\\N{GUJARATI SIGN CANDRABINDU}\\\\N{REPLACEMENT CHARACTER}\\\\N{<control-0004>}\\\\N{<control-0009>}\\\\N{<control-0081>}\\\\N{<noncharacter-FFFF>}"));
+    expect(*name2uni, UNICODE_STRING_SIMPLE("{\\N { NO-BREAK SPACE}abc\\N{  CJK UNIFIED  IDEOGRAPH-4E01  }\\N{x\\N{MICRO SIGN}\\N{GUJARATI SIGN CANDRABINDU}\\N{REPLACEMENT CHARACTER}\\N{<control-0004>}\\N{<control-0009>}\\N{<control-0081>}\\N{<noncharacter-FFFF>}\\N{<control-0004>}\\N{"),
            CharsToUnicodeString("{\\u00A0abc\\u4E01\\\\N{x\\u00B5\\u0A81\\uFFFD\\u0004\\u0009\\u0081\\uFFFF\\u0004\\\\N{"));
 
     delete uni2name;
@@ -1312,8 +1319,8 @@ void TransliteratorTest::TestLiberalizedID(void) {
     for (int32_t i=0; i<DATA_length; i+=3) {
         Transliterator *t = Transliterator::createInstance(DATA[i], UTRANS_FORWARD, parseError, status);
         if (t == 0) {
-            errln(UnicodeString("FAIL: ") + DATA[i+2] +
-                  " cannot create ID \"" + DATA[i] + "\"");
+            dataerrln(UnicodeString("FAIL: ") + DATA[i+2] +
+                  " cannot create ID \"" + DATA[i] + "\" - " + u_errorName(status));
         } else {
             UnicodeString exp;
             if (DATA[i+1]) {
@@ -1377,7 +1384,7 @@ void TransliteratorTest::TestCreateInstance(){
             logln((UnicodeString)"Ok: createInstance(" +
                   id + "," + DATA[i+1] + ") => " + newID);
         } else {
-            errln((UnicodeString)"FAIL: createInstance(" +
+            dataerrln((UnicodeString)"FAIL: createInstance(" +
                   id + "," + DATA[i+1] + ") => " + newID +
                   ", expected " + expID);
         }
@@ -1452,7 +1459,7 @@ void TransliteratorTest::TestNormalizationTransliterator() {
     Transliterator* NFD = Transliterator::createInstance("NFD", UTRANS_FORWARD, parseError, status);
     Transliterator* NFC = Transliterator::createInstance("NFC", UTRANS_FORWARD, parseError, status);
     if (!NFD || !NFC) {
-        errln("FAIL: createInstance failed");
+        dataerrln("FAIL: createInstance failed: %s", u_errorName(status));
         delete NFD;
         delete NFC;
         return;
@@ -1470,7 +1477,7 @@ void TransliteratorTest::TestNormalizationTransliterator() {
     Transliterator* NFKD = Transliterator::createInstance("NFKD", UTRANS_FORWARD, parseError, status);
     Transliterator* NFKC = Transliterator::createInstance("NFKC", UTRANS_FORWARD, parseError, status);
     if (!NFKD || !NFKC) {
-        errln("FAIL: createInstance failed");
+        dataerrln("FAIL: createInstance failed");
         delete NFKD;
         delete NFKC;
         return;
@@ -1532,7 +1539,7 @@ void TransliteratorTest::TestCompoundRBT(void) {
     // Now test toRules
     t = Transliterator::createInstance("Greek-Latin; Latin-Cyrillic", UTRANS_FORWARD, parseError, status);
     if (t == 0) {
-        errln("FAIL: createInstance failed");
+        dataerrln("FAIL: createInstance failed - %s", u_errorName(status));
         return;
     }
     UnicodeString exp("::Greek-Latin;\n::Latin-Cyrillic;");
@@ -1620,7 +1627,7 @@ void TransliteratorTest::TestCompoundFilter(void) {
     Transliterator *t = Transliterator::createInstance
         ("Greek-Latin; Latin-Greek; Lower", UTRANS_FORWARD, parseError, status);
     if (t == 0) {
-        errln("FAIL: createInstance failed");
+        dataerrln("FAIL: createInstance failed - %s", u_errorName(status));
         return;
     }
     t->adoptFilter(new UnicodeSet("[^A]", status));
@@ -1731,7 +1738,7 @@ void TransliteratorTest::TestToRules(void) {
             Transliterator *t = Transliterator::createFromRules("ID",
                                                                 UnicodeString(DATA[d+1], -1, US_INV), UTRANS_FORWARD, parseError, status);
             if (t == 0) {
-                errln("FAIL: createFromRules failed");
+                dataerrln("FAIL: createFromRules failed - %s", u_errorName(status));
                 return;
             }
             UnicodeString rules, escapedRules;
@@ -2073,7 +2080,7 @@ void TransliteratorTest::TestCompoundInverse(void) {
     Transliterator *t = Transliterator::createInstance
         ("Greek-Latin; Title()", UTRANS_REVERSE,parseError, status);
     if (t == 0) {
-        errln("FAIL: createInstance");
+        dataerrln("FAIL: createInstance - %s", u_errorName(status));
         return;
     }
     UnicodeString exp("(Title);Latin-Greek");
@@ -2097,7 +2104,7 @@ void TransliteratorTest::TestNFDChainRBT() {
                                "TEST", "::NFD; aa > Q; a > q;",
                                UTRANS_FORWARD, pe, ec);
     if (t == NULL || U_FAILURE(ec)) {
-        errln("FAIL: Transliterator::createFromRules failed with %s", u_errorName(ec));
+        dataerrln("FAIL: Transliterator::createFromRules failed with %s", u_errorName(ec));
         return;
     }
     expect(*t, "aa", "Q");
@@ -2224,7 +2231,7 @@ void TransliteratorTest::TestAliasInverseID() {
     UErrorCode ec = U_ZERO_ERROR;
     Transliterator *t = Transliterator::createInstance(ID, UTRANS_FORWARD, pe, ec);
     if (t == 0 || U_FAILURE(ec)) {
-        errln("FAIL: createInstance");
+        dataerrln("FAIL: createInstance - %s", u_errorName(ec));
         return;
     }
     Transliterator *u = t->createInverse(ec);
@@ -2252,7 +2259,7 @@ void TransliteratorTest::TestCompoundInverseID() {
     UErrorCode ec = U_ZERO_ERROR;
     Transliterator *t = Transliterator::createInstance(ID, UTRANS_FORWARD, pe, ec);
     if (t == 0 || U_FAILURE(ec)) {
-        errln("FAIL: createInstance");
+        dataerrln("FAIL: createInstance - %s", u_errorName(ec));
         return;
     }
     Transliterator *u = t->createInverse(ec);
@@ -2354,7 +2361,7 @@ void TransliteratorTest::TestCompoundFilterID(void) {
             }
             delete t;
         } else {
-            errln((UnicodeString)"FAIL: " + id + " => " + transID + ", " +
+            dataerrln((UnicodeString)"FAIL: " + id + " => " + transID + ", " +
                   u_errorName(ec));
         }
     }
@@ -2377,7 +2384,7 @@ void TransliteratorTest::TestNewEngine() {
     UErrorCode ec = U_ZERO_ERROR;
     Transliterator *t = Transliterator::createInstance("Latin-Hiragana", UTRANS_FORWARD, pe, ec);
     if (t == 0 || U_FAILURE(ec)) {
-        errln("FAIL: createInstance Latin-Hiragana");
+        dataerrln("FAIL: createInstance Latin-Hiragana - %s", u_errorName(ec));
         return;
     }
     // Katakana should be untouched
@@ -2636,8 +2643,8 @@ void TransliteratorTest::TestDevanagariLatinRT(){
     Transliterator* latinToDev=Transliterator::createInstance("Latin-Devanagari", UTRANS_FORWARD, parseError, status);
     Transliterator* devToLatin=Transliterator::createInstance("Devanagari-Latin", UTRANS_FORWARD, parseError, status);
     if(U_FAILURE(status)){
-        errln("FAIL: construction " +   UnicodeString(" Error: ") + u_errorName(status));
-        errln("PreContext: " + prettify(parseError.preContext) + " PostContext: " + prettify( parseError.postContext) );
+        dataerrln("FAIL: construction " +   UnicodeString(" Error: ") + u_errorName(status));
+        dataerrln("PreContext: " + prettify(parseError.preContext) + " PostContext: " + prettify( parseError.postContext) );
         return;
     }
     UnicodeString gotResult;
@@ -2684,8 +2691,8 @@ void TransliteratorTest::TestTeluguLatinRT(){
     Transliterator* latinToDev=Transliterator::createInstance("Latin-Telugu", UTRANS_FORWARD, parseError, status);
     Transliterator* devToLatin=Transliterator::createInstance("Telugu-Latin", UTRANS_FORWARD, parseError, status);
     if(U_FAILURE(status)){
-        errln("FAIL: construction " +   UnicodeString(" Error: ") + u_errorName(status));
-        errln("PreContext: " + prettify(parseError.preContext) + " PostContext: " + prettify( parseError.postContext) );
+        dataerrln("FAIL: construction " +   UnicodeString(" Error: ") + u_errorName(status));
+        dataerrln("PreContext: " + prettify(parseError.preContext) + " PostContext: " + prettify( parseError.postContext) );
         return;
     }
     UnicodeString gotResult;
@@ -2744,8 +2751,8 @@ void TransliteratorTest::TestSanskritLatinRT(){
     Transliterator* latinToDev=Transliterator::createInstance("Latin-Devanagari", UTRANS_FORWARD, parseError, status);
     Transliterator* devToLatin=Transliterator::createInstance("Devanagari-Latin", UTRANS_FORWARD, parseError, status);
     if(U_FAILURE(status)){
-        errln("FAIL: construction " +   UnicodeString(" Error: ") + u_errorName(status));
-        errln("PreContext: " + prettify(parseError.preContext) + " PostContext: " + prettify( parseError.postContext) );
+        dataerrln("FAIL: construction " +   UnicodeString(" Error: ") + u_errorName(status));
+        dataerrln("PreContext: " + prettify(parseError.preContext) + " PostContext: " + prettify( parseError.postContext) );
         return;
     }
     UnicodeString gotResult;
@@ -2813,8 +2820,8 @@ void TransliteratorTest::TestCompoundLatinRT(){
     Transliterator* latinToTelToLatin=Transliterator::createInstance("Latin-Telugu;Telugu-Latin", UTRANS_FORWARD, parseError, status);
 
     if(U_FAILURE(status)){
-        errln("FAIL: construction " +   UnicodeString(" Error: ") + u_errorName(status));
-        errln("PreContext: " + prettify(parseError.preContext) + " PostContext: " + prettify( parseError.postContext) );
+        dataerrln("FAIL: construction " +   UnicodeString(" Error: ") + u_errorName(status));
+        dataerrln("PreContext: " + prettify(parseError.preContext) + " PostContext: " + prettify( parseError.postContext) );
         return;
     }
     UnicodeString gotResult;
@@ -2847,7 +2854,7 @@ void TransliteratorTest::TestGurmukhiDevanagari(){
     UnicodeSetIterator nvIter(non_vowel);
     Transliterator* trans = Transliterator::createInstance("Devanagari-Gurmukhi",UTRANS_FORWARD, parseError, status);
     if(U_FAILURE(status)) {
-      errln("Error creating transliterator %s", u_errorName(status));
+      dataerrln("Error creating transliterator %s", u_errorName(status));
       delete trans;
       return;
     }
@@ -2879,7 +2886,7 @@ void TransliteratorTest::TestLocaleInstantiation(void) {
     UErrorCode ec = U_ZERO_ERROR;
     Transliterator *t = Transliterator::createInstance("ru_RU-Latin", UTRANS_FORWARD, pe, ec);
     if (U_FAILURE(ec)) {
-        errln("FAIL: createInstance(ru_RU-Latin)");
+        dataerrln("FAIL: createInstance(ru_RU-Latin) - %s", u_errorName(ec));
         delete t;
         return;
     }
@@ -2931,7 +2938,7 @@ void TransliteratorTest::TestLocaleResource() {
         UErrorCode ec = U_ZERO_ERROR;
         Transliterator *t = Transliterator::createInstance(DATA[i], UTRANS_FORWARD, pe, ec);
         if (U_FAILURE(ec)) {
-            errln((UnicodeString)"FAIL: createInstance(" + DATA[i] + ")");
+            dataerrln((UnicodeString)"FAIL: createInstance(" + DATA[i] + ") - " + u_errorName(ec));
             delete t;
             continue;
         }
@@ -3083,7 +3090,7 @@ void TransliteratorTest::TestIDForms() {
             if (!expValid) {
                 logln((UnicodeString)"Ok: getInstance(" + ID +") => " + u_errorName(ec));
             } else {
-                errln((UnicodeString)"FAIL: Couldn't create " + ID);
+                dataerrln((UnicodeString)"FAIL: Couldn't create " + ID + " - " + u_errorName(ec));
             }
             delete t;
             continue;
@@ -3172,7 +3179,7 @@ void TransliteratorTest::TestToRulesMark() {
     if (U_FAILURE(ec)) {
         delete t2;
         delete t3;
-        errln((UnicodeString)"FAIL: createFromRules => " + u_errorName(ec));
+        dataerrln((UnicodeString)"FAIL: createFromRules => " + u_errorName(ec));
         return;
     }
     
@@ -3289,7 +3296,7 @@ void TransliteratorTest::TestDisplayName() {
         UnicodeString name;
         Transliterator::getDisplayName(DATA[i], US, name);
         if (name != DATA[i+1]) {
-            errln((UnicodeString)"FAIL: " + DATA[i] + ".getDisplayName() => " +
+            dataerrln((UnicodeString)"FAIL: " + DATA[i] + ".getDisplayName() => " +
                   name + ", expected " + DATA[i+1]);
         } else {
             logln((UnicodeString)"Ok: " + DATA[i] + ".getDisplayName() => " + name);
@@ -3299,12 +3306,12 @@ void TransliteratorTest::TestDisplayName() {
         Transliterator *t = Transliterator::createInstance(DATA[i], UTRANS_REVERSE, pe, ec);
         if (U_FAILURE(ec)) {
             delete t;
-            errln("FAIL: createInstance failed");
+            dataerrln("FAIL: createInstance failed - %s", u_errorName(ec));
             continue;
         }
         name = Transliterator::getDisplayName(t->getID(), US, name);
         if (name != DATA[i+2]) {
-            errln((UnicodeString)"FAIL: " + t->getID() + ".getDisplayName() => " +
+            dataerrln((UnicodeString)"FAIL: " + t->getID() + ".getDisplayName() => " +
                   name + ", expected " + DATA[i+2]);
         } else {
             logln((UnicodeString)"Ok: " + t->getID() + ".getDisplayName() => " + name);
@@ -3387,7 +3394,7 @@ void TransliteratorTest::TestSpecialCases(void) {
         Transliterator *t = Transliterator::createFromRules(registerRules[0+i], 
             registerRules[i+1], UTRANS_FORWARD, pos, status);
         if (U_FAILURE(status)) {
-            errln("Fails: Unable to create the transliterator from rules.");
+            dataerrln("Fails: Unable to create the transliterator from rules. - %s", u_errorName(status));
         } else {
             Transliterator::registerInstance(t);
         }
@@ -3398,7 +3405,7 @@ void TransliteratorTest::TestSpecialCases(void) {
         const UnicodeString& name = testCases[i];
         Transliterator *t = Transliterator::createInstance(name, UTRANS_FORWARD, pe, ec);
         if (U_FAILURE(ec)) {
-            errln((UnicodeString)"FAIL: Couldn't create " + name);
+            dataerrln((UnicodeString)"FAIL: Couldn't create " + name + " - " + u_errorName(ec));
             delete t;
             continue;
         }
@@ -3453,7 +3460,7 @@ void TransliteratorTest::TestSurrogateCasing (void) {
     char buffer[20];
     UChar buffer2[20];
     UChar32 dee;
-    UTF_GET_CHAR(DESERET_dee,0, 0, DESERET_dee.length(), dee);
+    U16_GET(DESERET_dee,0, 0, DESERET_dee.length(), dee);
     UnicodeString DEE(u_totitle(dee));
     if (DEE != DESERET_DEE) {
         err("Fails titlecase of surrogates");
@@ -3554,7 +3561,7 @@ void TransliteratorTest::TestIncrementalProgress(void) {
                 
                 Transliterator *t = Transliterator::createInstance(id, UTRANS_FORWARD, err, status);
                 if (U_FAILURE(status)) {
-                    errln((UnicodeString)"FAIL: Could not create " + id);
+                    dataerrln((UnicodeString)"FAIL: Could not create " + id);
                     delete t;
                     continue;
                 }
@@ -3565,7 +3572,12 @@ void TransliteratorTest::TestIncrementalProgress(void) {
                 _trans(*t, test, rev);
                 Transliterator *inv = t->createInverse(status);
                 if (U_FAILURE(status)) {
-                    errln((UnicodeString)"FAIL: Could not create inverse of " + id);
+#if UCONFIG_NO_BREAK_ITERATION
+                    // If UCONFIG_NO_BREAK_ITERATION is on, then only Thai should fail.
+                    if (id.compare((UnicodeString)"Latin-Thai/") != 0)
+#endif
+                        errln((UnicodeString)"FAIL: Could not create inverse of " + id);
+
                     delete t;
                     delete inv;
                     continue;
@@ -3595,6 +3607,7 @@ void TransliteratorTest::CheckIncrementalAux(const Transliterator* t,
         return;
     }
     UBool gotError = FALSE;
+    (void)gotError;    // Suppress set but not used warning.
 
     // we have a few special cases. Any-Remove (pos.start = 0, but also = limit) and U+XXXXX?X?
 
@@ -3625,7 +3638,7 @@ void TransliteratorTest::TestFunction() {
     UErrorCode ec = U_ZERO_ERROR;
     Transliterator *t = Transliterator::createFromRules("Test", rule, UTRANS_FORWARD, pe, ec);
     if (t == NULL) {
-        errln("FAIL: createFromRules failed");
+        dataerrln("FAIL: createFromRules failed - %s", u_errorName(ec));
         return;
     }
     
@@ -3760,7 +3773,7 @@ void TransliteratorTest::TestUserFunction() {
                                         UNICODE_STRING_SIMPLE("'\\'u(..)(..) > '<img src=\"http://www.unicode.org/gifs/24/' $1 '/U' $1$2 '.gif\">';"),
                                         UTRANS_FORWARD, pe, ec);
     if (t == NULL || U_FAILURE(ec)) {
-        errln((UnicodeString)"FAIL: createFromRules gif " + u_errorName(ec));
+        dataerrln((UnicodeString)"FAIL: createFromRules gif " + u_errorName(ec));
         return;
     }
     _TUFReg("Any-gif", t, 0);
@@ -3839,7 +3852,7 @@ void TransliteratorTest::TestAnyX(void) {
     Transliterator* anyLatin =
         Transliterator::createInstance("Any-Latin", UTRANS_FORWARD, parseError, status);
     if (anyLatin==0) {
-        errln("FAIL: createInstance returned NULL");
+        dataerrln("FAIL: createInstance returned NULL - %s", u_errorName(status));
         delete anyLatin;
         return;
     }
@@ -3851,6 +3864,59 @@ void TransliteratorTest::TestAnyX(void) {
     delete anyLatin;
 }
 
+/**
+ * Test Any-X transliterators with sample letters from all scripts.
+ */
+void TransliteratorTest::TestAny(void) {
+    UErrorCode status = U_ZERO_ERROR;
+    // Note: there is a lot of implict construction of UnicodeStrings from (char *) in
+    //       function call parameters going on in this test.
+    UnicodeSet alphabetic("[:alphabetic:]", status);
+    if (U_FAILURE(status)) {
+        dataerrln("Failure: file %s, line %d, status = %s", __FILE__, __LINE__, u_errorName(status));
+        return;
+    }
+    alphabetic.freeze();
+
+    UnicodeString testString;
+    for (int32_t i = 0; i < USCRIPT_CODE_LIMIT; i++) {
+        const char *scriptName = uscript_getShortName((UScriptCode)i);
+        if (scriptName == NULL) {
+            errln("Failure: file %s, line %d: Script Code %d is invalid, ", __FILE__, __LINE__, i);
+            return;
+        }
+
+        UnicodeSet sample;
+        sample.applyPropertyAlias("script", scriptName, status);
+        if (U_FAILURE(status)) {
+            errln("Failure: file %s, line %d, status = %s", __FILE__, __LINE__, u_errorName(status));
+            return;
+        }
+        sample.retainAll(alphabetic);
+        for (int32_t count=0; count<5; count++) {
+            UChar32 c = sample.charAt(count);
+            if (c == -1) {
+                break;
+            }
+            testString.append(c);
+        }
+    }
+
+    UParseError parseError;
+    Transliterator* anyLatin =
+        Transliterator::createInstance("Any-Latin", UTRANS_FORWARD, parseError, status);
+    if (U_FAILURE(status)) {
+        dataerrln("Failure: file %s, line %d, status = %s", __FILE__, __LINE__, u_errorName(status));
+        return;
+    }
+
+    logln(UnicodeString("Sample set for Any-Latin: ") + testString);
+    anyLatin->transliterate(testString);
+    logln(UnicodeString("Sample result for Any-Latin: ") + testString);
+    delete anyLatin;
+}
+
+
 /**
  * Test the source and target set API.  These are only implemented
  * for RBT and CompoundTransliterator at this time.
@@ -3899,9 +3965,9 @@ void TransliteratorTest::TestSourceTargetSet() {
 }
 
 /**
- * Test handling of rule whitespace, for both RBT and UnicodeSet.
+ * Test handling of Pattern_White_Space, for both RBT and UnicodeSet.
  */
-void TransliteratorTest::TestRuleWhitespace() {
+void TransliteratorTest::TestPatternWhiteSpace() {
     // Rules
     const char* r = "a > \\u200E b;";
     
@@ -3946,11 +4012,11 @@ void TransliteratorTest::TestAllCodepoints(){
     for(uint32_t i = 0; i<=0x10ffff; i++){
         code =  uscript_getScript(i,&status);
         if(code == USCRIPT_INVALID_CODE){
-            errln("uscript_getScript for codepoint \\U%08X failed.\n", i);
+            dataerrln("uscript_getScript for codepoint \\U%08X failed.", i);
         }
         const char* myId = uscript_getName(code);
         if(!myId) {
-          errln("Valid script code returned NULL name. Check your data!");
+          dataerrln("Valid script code returned NULL name. Check your data!");
           return;
         }
         uprv_strcpy(id,myId);
@@ -3967,14 +4033,14 @@ void TransliteratorTest::TestAllCodepoints(){
         if(uprv_strcmp(newId,oldId)!=0){
             Transliterator* t = Transliterator::createInstance(newId,UTRANS_FORWARD,pe,status);
             if(t==NULL || U_FAILURE(status)){
-                errln((UnicodeString)"FAIL: Could not create " + id);
+                dataerrln((UnicodeString)"FAIL: Could not create " + id + " - " + u_errorName(status));
             }
             delete t;
         }
         if(uprv_strcmp(newAbbrId,oldAbbrId)!=0){
             Transliterator* t = Transliterator::createInstance(newAbbrId,UTRANS_FORWARD,pe,status);
             if(t==NULL || U_FAILURE(status)){
-                errln((UnicodeString)"FAIL: Could not create " + id);
+                dataerrln((UnicodeString)"FAIL: Could not create " + id + " - " + u_errorName(status));
             }
             delete t;
         }
@@ -3989,7 +4055,7 @@ void TransliteratorTest::TestAllCodepoints(){
   UErrorCode ec = U_ZERO_ERROR; \
   Transliterator* t = Transliterator::createInstance(id, UTRANS_FORWARD, ec); \
   if (U_FAILURE(ec)) { \
-    errln("FAIL: Couldn't create " id); \
+    dataerrln("FAIL: Couldn't create %s - %s", id, u_errorName(ec)); \
   } else { \
     if (t->getDynamicClassID() != cls::getStaticClassID()) { \
       errln("FAIL: " #cls " dynamic and static class ID mismatch"); \
@@ -4216,7 +4282,6 @@ static const char* BEGIN_END_RULES[] = {
     "::Upper(Lower);"
     "::([XYZ]);"
 };
-static const int32_t BEGIN_END_RULES_length = (int32_t)(sizeof(BEGIN_END_RULES) / sizeof(BEGIN_END_RULES[0]));
 
 /*
 (This entire test is commented out below and will need some heavy revision when we re-add
@@ -4423,7 +4488,7 @@ void TransliteratorTest::TestRegisterAlias() {
     err = U_ZERO_ERROR;
     t1 = Transliterator::createInstance(realID, UTRANS_FORWARD, err);
     if (U_FAILURE(err)) {
-        errln("Failed to instantiate transliterator with real ID");
+        dataerrln("Failed to instantiate transliterator with real ID - %s", u_errorName(err));
         Transliterator::unregister(realID);
         return;
     }
@@ -4477,7 +4542,7 @@ void TransliteratorTest::TestHalfwidthFullwidth(void) {
     Transliterator* hf = Transliterator::createInstance("Halfwidth-Fullwidth", UTRANS_FORWARD, parseError, status);
     Transliterator* fh = Transliterator::createInstance("Fullwidth-Halfwidth", UTRANS_FORWARD, parseError, status);
     if (hf == 0 || fh == 0) {
-        errln("FAIL: createInstance failed");
+        dataerrln("FAIL: createInstance failed - %s", u_errorName(status));
         delete hf;
         delete fh;
         return;
@@ -4522,11 +4587,12 @@ void TransliteratorTest::TestHalfwidthFullwidth(void) {
      *              For now, test just confirms that C++ and Java give identical results.
      */
 void TransliteratorTest::TestThai(void) {
+#if !UCONFIG_NO_BREAK_ITERATION
     UParseError parseError;
     UErrorCode status = U_ZERO_ERROR;
     Transliterator* tr = Transliterator::createInstance("Any-Latin", UTRANS_FORWARD, parseError, status);
     if (tr == 0) {
-        errln("FAIL: createInstance failed");
+        dataerrln("FAIL: createInstance failed - %s", u_errorName(status));
         return;
     }
     if (U_FAILURE(status)) {
@@ -4595,6 +4661,7 @@ void TransliteratorTest::TestThai(void) {
     expect(*tr, xlitText, expectedText);
     
     delete tr;
+#endif
 }
 
 
@@ -4608,7 +4675,7 @@ void TransliteratorTest::expectT(const UnicodeString& id,
     UParseError pe;
     Transliterator *t = Transliterator::createInstance(id, UTRANS_FORWARD, pe, ec);
     if (U_FAILURE(ec)) {
-        errln((UnicodeString)"FAIL: Could not create " + id);
+        errln((UnicodeString)"FAIL: Could not create " + id + " -  " + u_errorName(ec));
         delete t;
         return;
     }
@@ -4619,7 +4686,7 @@ void TransliteratorTest::expectT(const UnicodeString& id,
 void TransliteratorTest::reportParseError(const UnicodeString& message,
                                           const UParseError& parseError,
                                           const UErrorCode& status) {
-    errln(message +
+    dataerrln(message +
           /*", parse error " + parseError.code +*/
           ", line " + parseError.line +
           ", offset " + parseError.offset +
@@ -4767,7 +4834,7 @@ void TransliteratorTest::expectAux(const UnicodeString& tag,
     if (pass) {
         logln(UnicodeString("(")+tag+") " + prettify(summary));
     } else {
-        errln(UnicodeString("FAIL: (")+tag+") "
+        dataerrln(UnicodeString("FAIL: (")+tag+") "
               + prettify(summary)
               + ", expected " + prettify(expectedResult));
     }