From e29f4f62c48097f8c0977bc0a221ab5359ba76f3 Mon Sep 17 00:00:00 2001 From: George Rhoten Date: Fri, 31 Aug 2001 18:02:09 +0000 Subject: [PATCH] ICU-770 Make the tests build and/or run faster X-SVN-Rev: 5659 --- icu4c/source/test/intltest/allcoll.h | 17 +- icu4c/source/test/intltest/apicoll.h | 17 +- icu4c/source/test/intltest/callimts.h | 1 - icu4c/source/test/intltest/calregts.h | 1 - icu4c/source/test/intltest/caltest.h | 1 - icu4c/source/test/intltest/caltztst.h | 1 - icu4c/source/test/intltest/citrtest.h | 5 +- icu4c/source/test/intltest/cpdtrtst.h | 1 - icu4c/source/test/intltest/currcoll.h | 21 +- icu4c/source/test/intltest/dacoll.h | 14 +- icu4c/source/test/intltest/dcfmapts.h | 1 - icu4c/source/test/intltest/decoll.h | 14 +- icu4c/source/test/intltest/dtfmapts.h | 1 - icu4c/source/test/intltest/dtfmrgts.h | 1 - icu4c/source/test/intltest/dtfmtrtts.h | 2 - icu4c/source/test/intltest/dtfmttst.h | 1 - icu4c/source/test/intltest/encoll.h | 14 +- icu4c/source/test/intltest/escoll.h | 14 +- icu4c/source/test/intltest/ficoll.h | 14 +- icu4c/source/test/intltest/frcoll.h | 14 +- icu4c/source/test/intltest/g7coll.h | 6 +- icu4c/source/test/intltest/hajatrts.h | 1 - icu4c/source/test/intltest/hxuntrts.h | 1 - icu4c/source/test/intltest/intltest.cpp | 138 ++----------- icu4c/source/test/intltest/intltest.dsp | 8 - icu4c/source/test/intltest/intltest.h | 14 +- icu4c/source/test/intltest/itconv.h | 1 - icu4c/source/test/intltest/itercoll.h | 24 +-- icu4c/source/test/intltest/itformat.h | 1 - icu4c/source/test/intltest/itmajor.h | 1 - icu4c/source/test/intltest/itrbbi.h | 1 - icu4c/source/test/intltest/ittrans.h | 1 - icu4c/source/test/intltest/ittxtbd.h | 1 - icu4c/source/test/intltest/itutil.h | 1 - icu4c/source/test/intltest/jacoll.h | 14 +- icu4c/source/test/intltest/jahatrts.h | 1 - icu4c/source/test/intltest/lcukocol.h | 16 +- icu4c/source/test/intltest/miscdtfm.h | 1 - icu4c/source/test/intltest/mnkytst.h | 14 +- icu4c/source/test/intltest/msfmrgts.h | 1 - icu4c/source/test/intltest/nmfmapts.h | 1 - icu4c/source/test/intltest/nmfmtrt.h | 87 ++++---- icu4c/source/test/intltest/numfmtst.h | 1 - icu4c/source/test/intltest/numrgts.h | 3 - icu4c/source/test/intltest/pptest.h | 1 - icu4c/source/test/intltest/rbbiapts.h | 1 - icu4c/source/test/intltest/rbbitst.h | 1 - icu4c/source/test/intltest/regcoll.h | 21 +- icu4c/source/test/intltest/restest.h | 4 + icu4c/source/test/intltest/restsnew.h | 4 + icu4c/source/test/intltest/sdtfmtts.h | 1 - icu4c/source/test/intltest/sfwdchit.h | 1 - icu4c/source/test/intltest/srchtest.h | 1 - icu4c/source/test/intltest/strtest.h | 1 - icu4c/source/test/intltest/tchcfmt.h | 1 - icu4c/source/test/intltest/testutil.cpp | 2 +- icu4c/source/test/intltest/testutil.h | 3 +- icu4c/source/test/intltest/tfsmalls.h | 7 +- icu4c/source/test/intltest/thcoll.cpp | 14 +- icu4c/source/test/intltest/thcoll.h | 10 +- icu4c/source/test/intltest/tmsgfmt.h | 1 - icu4c/source/test/intltest/transapi.cpp | 1 + icu4c/source/test/intltest/transapi.h | 1 - icu4c/source/test/intltest/transrt.cpp | 254 ++++++++++++------------ icu4c/source/test/intltest/transrt.h | 1 - icu4c/source/test/intltest/transtst.h | 1 - icu4c/source/test/intltest/trcoll.h | 14 +- icu4c/source/test/intltest/tscoll.cpp | 119 +++++++++++ icu4c/source/test/intltest/tscoll.h | 13 +- icu4c/source/test/intltest/tsdate.h | 1 - icu4c/source/test/intltest/tsdcfmsy.h | 1 - icu4c/source/test/intltest/tsdtfmsy.h | 1 - icu4c/source/test/intltest/tsmthred.h | 5 +- icu4c/source/test/intltest/tsmutex.h | 12 +- icu4c/source/test/intltest/tsnmfmt.h | 2 +- icu4c/source/test/intltest/tsputil.h | 1 - icu4c/source/test/intltest/tstnorm.h | 13 -- icu4c/source/test/intltest/tzregts.h | 1 - icu4c/source/test/intltest/tztest.h | 1 - icu4c/source/test/intltest/ufltlgts.h | 1 - icu4c/source/test/intltest/unhxtrts.h | 1 - icu4c/source/test/intltest/usettest.h | 1 - icu4c/source/test/intltest/ustrtest.h | 4 + 83 files changed, 403 insertions(+), 613 deletions(-) diff --git a/icu4c/source/test/intltest/allcoll.h b/icu4c/source/test/intltest/allcoll.h index 5bfd4b788dc..1bd8da6a02e 100644 --- a/icu4c/source/test/intltest/allcoll.h +++ b/icu4c/source/test/intltest/allcoll.h @@ -13,23 +13,10 @@ #ifndef _ALLCOLL #define _ALLCOLL -#ifndef _UTYPES -#include "unicode/utypes.h" -#endif - -#ifndef _COLL -#include "unicode/coll.h" -#endif - -#ifndef _TBLCOLL #include "unicode/tblcoll.h" -#endif +#include "tscoll.h" -#ifndef _INTLTEST -#include "intltest.h" -#endif - -class CollationDummyTest: public IntlTest { +class CollationDummyTest: public IntlTestCollator { public: // If this is too small for the test data, just increase it. // Just don't make it too large, otherwise the executable will get too big diff --git a/icu4c/source/test/intltest/apicoll.h b/icu4c/source/test/intltest/apicoll.h index 4e599bd834d..433c3a4592f 100644 --- a/icu4c/source/test/intltest/apicoll.h +++ b/icu4c/source/test/intltest/apicoll.h @@ -12,23 +12,10 @@ #ifndef _APICOLL #define _APICOLL -#ifndef _UTYPES -#include "unicode/utypes.h" -#endif - -#ifndef _COLL -#include "unicode/coll.h" -#endif - -#ifndef _TBLCOLL #include "unicode/tblcoll.h" -#endif +#include "tscoll.h" -#ifndef _INTLTEST -#include "intltest.h" -#endif - -class CollationAPITest: public IntlTest { +class CollationAPITest: public IntlTestCollator { public: void runIndexedTest( int32_t index, UBool exec, const char* &name, char* /*par = NULL */); void doAssert(UBool condition, const char *message); diff --git a/icu4c/source/test/intltest/callimts.h b/icu4c/source/test/intltest/callimts.h index 1249222de62..1890aa3e174 100644 --- a/icu4c/source/test/intltest/callimts.h +++ b/icu4c/source/test/intltest/callimts.h @@ -7,7 +7,6 @@ #ifndef __CalendarLimitTest__ #define __CalendarLimitTest__ -#include "unicode/utypes.h" #include "caltztst.h" class Calendar; class DateFormat; diff --git a/icu4c/source/test/intltest/calregts.h b/icu4c/source/test/intltest/calregts.h index ce39097a759..7b4014eb3d6 100644 --- a/icu4c/source/test/intltest/calregts.h +++ b/icu4c/source/test/intltest/calregts.h @@ -7,7 +7,6 @@ #ifndef _CALENDARREGRESSIONTEST_ #define _CALENDARREGRESSIONTEST_ -#include "unicode/utypes.h" #include "unicode/calendar.h" #include "intltest.h" diff --git a/icu4c/source/test/intltest/caltest.h b/icu4c/source/test/intltest/caltest.h index 6385788ade1..5f51c602c58 100644 --- a/icu4c/source/test/intltest/caltest.h +++ b/icu4c/source/test/intltest/caltest.h @@ -7,7 +7,6 @@ #ifndef __CalendarTest__ #define __CalendarTest__ -#include "unicode/utypes.h" #include "caltztst.h" #include "unicode/calendar.h" diff --git a/icu4c/source/test/intltest/caltztst.h b/icu4c/source/test/intltest/caltztst.h index e088cf431ad..2b2b93a7963 100644 --- a/icu4c/source/test/intltest/caltztst.h +++ b/icu4c/source/test/intltest/caltztst.h @@ -8,7 +8,6 @@ #ifndef _CALTZTST #define _CALTZTST -#include "unicode/utypes.h" #include "unicode/unistr.h" #include "intltest.h" class SimpleDateFormat; diff --git a/icu4c/source/test/intltest/citrtest.h b/icu4c/source/test/intltest/citrtest.h index ef3fbe3d014..347f0b47462 100644 --- a/icu4c/source/test/intltest/citrtest.h +++ b/icu4c/source/test/intltest/citrtest.h @@ -4,6 +4,9 @@ * others. All Rights Reserved. ********************************************************************/ +#ifndef CHARITERTEST_H +#define CHARITERTEST_H + #include "intltest.h" /** @@ -33,5 +36,5 @@ public: void TestIterationUChar32(void); }; - +#endif diff --git a/icu4c/source/test/intltest/cpdtrtst.h b/icu4c/source/test/intltest/cpdtrtst.h index 282060cdc6d..a795c66cc59 100644 --- a/icu4c/source/test/intltest/cpdtrtst.h +++ b/icu4c/source/test/intltest/cpdtrtst.h @@ -13,7 +13,6 @@ #ifndef CPDTRTST_H #define CPDTRTST_H -#include "unicode/utypes.h" #include "unicode/translit.h" #include "unicode/cpdtrans.h" #include "intltest.h" diff --git a/icu4c/source/test/intltest/currcoll.h b/icu4c/source/test/intltest/currcoll.h index bb2af6ea9f8..2741f21dbcb 100644 --- a/icu4c/source/test/intltest/currcoll.h +++ b/icu4c/source/test/intltest/currcoll.h @@ -12,27 +12,10 @@ #ifndef _CURRCOLL #define _CURRCOLL -#ifndef _UTYPES -#include "unicode/utypes.h" -#endif - -#ifndef _COLL -#include "unicode/coll.h" -#endif - -#ifndef _COLEITR #include "unicode/coleitr.h" -#endif +#include "tscoll.h" -#ifndef _INTLTEST -#include "intltest.h" -#endif - -#ifndef _UNISTR -#include "unicode/unistr.h" -#endif - -class CollationCurrencyTest: public IntlTest +class CollationCurrencyTest: public IntlTestCollator { public: diff --git a/icu4c/source/test/intltest/dacoll.h b/icu4c/source/test/intltest/dacoll.h index 9d64cb489be..51cab12e040 100644 --- a/icu4c/source/test/intltest/dacoll.h +++ b/icu4c/source/test/intltest/dacoll.h @@ -14,19 +14,9 @@ #ifndef _DACOLL #define _DACOLL -#ifndef _UTYPES -#include "unicode/utypes.h" -#endif +#include "tscoll.h" -#ifndef _COLL -#include "unicode/coll.h" -#endif - -#ifndef _INTLTEST -#include "intltest.h" -#endif - -class CollationDanishTest: public IntlTest { +class CollationDanishTest: public IntlTestCollator { public: // If this is too small for the test data, just increase it. // Just don't make it too large, otherwise the executable will get too big diff --git a/icu4c/source/test/intltest/dcfmapts.h b/icu4c/source/test/intltest/dcfmapts.h index 823bd19badd..7ab56198e4e 100644 --- a/icu4c/source/test/intltest/dcfmapts.h +++ b/icu4c/source/test/intltest/dcfmapts.h @@ -9,7 +9,6 @@ #define _INTLTESTDECIMALFORMATAPI -#include "unicode/utypes.h" #include "intltest.h" diff --git a/icu4c/source/test/intltest/decoll.h b/icu4c/source/test/intltest/decoll.h index 4660d0722c8..4c47f8a392e 100644 --- a/icu4c/source/test/intltest/decoll.h +++ b/icu4c/source/test/intltest/decoll.h @@ -12,19 +12,9 @@ #ifndef _DECOLL #define _DECOLL -#ifndef _UTYPES -#include "unicode/utypes.h" -#endif +#include "tscoll.h" -#ifndef _COLL -#include "unicode/coll.h" -#endif - -#ifndef _INTLTEST -#include "intltest.h" -#endif - -class CollationGermanTest: public IntlTest { +class CollationGermanTest: public IntlTestCollator { public: // If this is too small for the test data, just increase it. // Just don't make it too large, otherwise the executable will get too big diff --git a/icu4c/source/test/intltest/dtfmapts.h b/icu4c/source/test/intltest/dtfmapts.h index d0a5fd311cf..b827a93ae58 100644 --- a/icu4c/source/test/intltest/dtfmapts.h +++ b/icu4c/source/test/intltest/dtfmapts.h @@ -8,7 +8,6 @@ #define _INTLTESTDATEFORMATAPI -#include "unicode/utypes.h" #include "intltest.h" diff --git a/icu4c/source/test/intltest/dtfmrgts.h b/icu4c/source/test/intltest/dtfmrgts.h index 6add4baafa7..4288bc42556 100644 --- a/icu4c/source/test/intltest/dtfmrgts.h +++ b/icu4c/source/test/intltest/dtfmrgts.h @@ -7,7 +7,6 @@ #ifndef _DATEFORMATREGRESSIONTEST_ #define _DATEFORMATREGRESSIONTEST_ -#include "unicode/utypes.h" #include "caltztst.h" class SimpleDateFormat; diff --git a/icu4c/source/test/intltest/dtfmtrtts.h b/icu4c/source/test/intltest/dtfmtrtts.h index e74b4005eb7..a0d221f34d2 100644 --- a/icu4c/source/test/intltest/dtfmtrtts.h +++ b/icu4c/source/test/intltest/dtfmtrtts.h @@ -9,9 +9,7 @@ #include -#include "unicode/utypes.h" #include "intltest.h" -#include "locale.h" #include "unicode/unistr.h" class DateFormat; diff --git a/icu4c/source/test/intltest/dtfmttst.h b/icu4c/source/test/intltest/dtfmttst.h index 37f96783803..f974004bd2b 100644 --- a/icu4c/source/test/intltest/dtfmttst.h +++ b/icu4c/source/test/intltest/dtfmttst.h @@ -7,7 +7,6 @@ #ifndef _DATEFORMATTEST_ #define _DATEFORMATTEST_ -#include "unicode/utypes.h" #include "caltztst.h" #include "unicode/datefmt.h" diff --git a/icu4c/source/test/intltest/encoll.h b/icu4c/source/test/intltest/encoll.h index 8a124f9a0ab..8ca40fa97b0 100644 --- a/icu4c/source/test/intltest/encoll.h +++ b/icu4c/source/test/intltest/encoll.h @@ -14,19 +14,9 @@ #ifndef _ENCOLL #define _ENCOLL -#ifndef _UTYPES -#include "unicode/utypes.h" -#endif +#include "tscoll.h" -#ifndef _COLL -#include "unicode/coll.h" -#endif - -#ifndef _INTLTEST -#include "intltest.h" -#endif - -class CollationEnglishTest: public IntlTest { +class CollationEnglishTest: public IntlTestCollator { public: // If this is too small for the test data, just increase it. // Just don't make it too large, otherwise the executable will get too big diff --git a/icu4c/source/test/intltest/escoll.h b/icu4c/source/test/intltest/escoll.h index d5f405dd360..54c69b15558 100644 --- a/icu4c/source/test/intltest/escoll.h +++ b/icu4c/source/test/intltest/escoll.h @@ -14,19 +14,9 @@ #ifndef _ESCOLL #define _ESCOLL -#ifndef _UTYPES -#include "unicode/utypes.h" -#endif +#include "tscoll.h" -#ifndef _COLL -#include "unicode/coll.h" -#endif - -#ifndef _INTLTEST -#include "intltest.h" -#endif - -class CollationSpanishTest: public IntlTest { +class CollationSpanishTest: public IntlTestCollator { public: // If this is too small for the test data, just increase it. // Just don't make it too large, otherwise the executable will get too big diff --git a/icu4c/source/test/intltest/ficoll.h b/icu4c/source/test/intltest/ficoll.h index 596a6a9ffd7..4a45d7444a6 100644 --- a/icu4c/source/test/intltest/ficoll.h +++ b/icu4c/source/test/intltest/ficoll.h @@ -13,19 +13,9 @@ #ifndef _FICOLL #define _FICOLL -#ifndef _UTYPES -#include "unicode/utypes.h" -#endif +#include "tscoll.h" -#ifndef _COLL -#include "unicode/coll.h" -#endif - -#ifndef _INTLTEST -#include "intltest.h" -#endif - -class CollationFinnishTest: public IntlTest { +class CollationFinnishTest: public IntlTestCollator { public: // If this is too small for the test data, just increase it. // Just don't make it too large, otherwise the executable will get too big diff --git a/icu4c/source/test/intltest/frcoll.h b/icu4c/source/test/intltest/frcoll.h index 7376286eb37..0bee6c95fcd 100644 --- a/icu4c/source/test/intltest/frcoll.h +++ b/icu4c/source/test/intltest/frcoll.h @@ -12,19 +12,9 @@ #ifndef _FRCOLL #define _FRCOLL -#ifndef _UTYPES -#include "unicode/utypes.h" -#endif +#include "tscoll.h" -#ifndef _COLL -#include "unicode/coll.h" -#endif - -#ifndef _INTLTEST -#include "intltest.h" -#endif - -class CollationFrenchTest: public IntlTest { +class CollationFrenchTest: public IntlTestCollator { public: // If this is too small for the test data, just increase it. // Just don't make it too large, otherwise the executable will get too big diff --git a/icu4c/source/test/intltest/g7coll.h b/icu4c/source/test/intltest/g7coll.h index fc0fd3b5ada..c8729b96b7e 100644 --- a/icu4c/source/test/intltest/g7coll.h +++ b/icu4c/source/test/intltest/g7coll.h @@ -31,12 +31,10 @@ #ifndef _G7COLL #define _G7COLL -#include "unicode/utypes.h" -#include "unicode/coll.h" #include "unicode/tblcoll.h" -#include "intltest.h" +#include "tscoll.h" -class G7CollationTest: public IntlTest { +class G7CollationTest: public IntlTestCollator { public: // If this is too small for the test data, just increase it. // Just don't make it too large, otherwise the executable will get too big diff --git a/icu4c/source/test/intltest/hajatrts.h b/icu4c/source/test/intltest/hajatrts.h index 4b7b6364bb3..a0945e56e0c 100644 --- a/icu4c/source/test/intltest/hajatrts.h +++ b/icu4c/source/test/intltest/hajatrts.h @@ -11,7 +11,6 @@ #ifndef HANGTOJAMOTRTST_H #define HANGTOJAMOTRTST_H -#include "unicode/utypes.h" #include "unicode/translit.h" #include "unicode/hangjamo.h" #include "intltest.h" diff --git a/icu4c/source/test/intltest/hxuntrts.h b/icu4c/source/test/intltest/hxuntrts.h index 81f89d4a27d..e3ec23b0a5d 100644 --- a/icu4c/source/test/intltest/hxuntrts.h +++ b/icu4c/source/test/intltest/hxuntrts.h @@ -11,7 +11,6 @@ #ifndef HEXTOUNITRTST_H #define HEXTOUNITRTST_H -#include "unicode/utypes.h" #include "unicode/translit.h" #include "unicode/hextouni.h" #include "intltest.h" diff --git a/icu4c/source/test/intltest/intltest.cpp b/icu4c/source/test/intltest/intltest.cpp index 460b2395304..08395d16223 100644 --- a/icu4c/source/test/intltest/intltest.cpp +++ b/icu4c/source/test/intltest/intltest.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include "unicode/unistr.h" #include "unicode/ures.h" @@ -169,79 +170,6 @@ UnicodeString operator+(const UnicodeString& left, float num) //------------------ -// used for collation result reporting, defined here for convenience -// (maybe moved later) -void -IntlTest::reportCResult( UnicodeString &source, UnicodeString &target, - CollationKey &sourceKey, CollationKey &targetKey, - Collator::EComparisonResult compareResult, - Collator::EComparisonResult keyResult, - Collator::EComparisonResult incResult, - Collator::EComparisonResult expectedResult ) -{ - if (expectedResult < -1 || expectedResult > 1) - { - errln("***** invalid call to reportCResult ****"); - return; - } - - UBool ok1 = (compareResult == expectedResult); - UBool ok2 = (keyResult == expectedResult); - UBool ok3 = (incResult == expectedResult); - - - if (ok1 && ok2 && ok3 && !verbose) { - // Keep non-verbose, passing tests fast - return; - } else { - UnicodeString msg1(ok1 ? "Ok: compare(" : "FAIL: compare("); - UnicodeString msg2(", "), msg3(") returned "), msg4("; expected "); - UnicodeString prettySource, prettyTarget, sExpect, sResult; - - prettify(source, prettySource); - prettify(target, prettyTarget); - appendCompareResult(compareResult, sResult); - appendCompareResult(expectedResult, sExpect); - - if (ok1) { - logln(msg1 + prettySource + msg2 + prettyTarget + msg3 + sResult); - } else { - errln(msg1 + prettySource + msg2 + prettyTarget + msg3 + sResult + msg4 + sExpect); - } - - msg1 = UnicodeString(ok2 ? "Ok: key(" : "FAIL: key("); - msg2 = ").compareTo(key("; - msg3 = ")) returned "; - - appendCompareResult(keyResult, sResult); - - if (ok2) { - logln(msg1 + prettySource + msg2 + prettyTarget + msg3 + sResult); - } else { - errln(msg1 + prettySource + msg2 + prettyTarget + msg3 + sResult + msg4 + sExpect); - - msg1 = " "; - msg2 = " vs. "; - - prettify(sourceKey, prettySource); - prettify(targetKey, prettyTarget); - - errln(msg1 + prettySource + msg2 + prettyTarget); - } - msg1 = UnicodeString (ok3 ? "Ok: incCompare(" : "FAIL: incCompare("); - msg2 = ", "; - msg3 = ") returned "; - - appendCompareResult(incResult, sResult); - - if (ok3) { - logln(msg1 + prettySource + msg2 + prettyTarget + msg3 + sResult); - } else { - errln(msg1 + prettySource + msg2 + prettyTarget + msg3 + sResult + msg4 + sExpect); - } - } -} - // Append a hex string to the target UnicodeString& IntlTest::appendHex(uint32_t number, @@ -278,32 +206,6 @@ IntlTest::appendHex(uint32_t number, return target; } -UnicodeString& -IntlTest::appendCompareResult(Collator::EComparisonResult result, - UnicodeString& target) -{ - if (result == Collator::LESS) - { - target += "LESS"; - } - else if (result == Collator::EQUAL) - { - target += "EQUAL"; - } - else if (result == Collator::GREATER) - { - target += "GREATER"; - } - else - { - UnicodeString huh = "?"; - - target += (huh + (int32_t)result); - } - - return target; -} - // Replace nonprintable characters with unicode escapes UnicodeString& IntlTest::prettify(const UnicodeString &source, @@ -391,26 +293,6 @@ IntlTest::prettify(const UnicodeString &source, UBool parseBackslash) return target; } -// Produce a printable representation of a CollationKey -UnicodeString &IntlTest::prettify(const CollationKey &source, UnicodeString &target) -{ - int32_t i, byteCount; - const uint8_t *bytes = source.getByteArray(byteCount); - - target.remove(); - target += "["; - - for (i = 0; i < byteCount; i += 1) - { - appendHex(bytes[i], 2, target); - target += " "; - } - - target += "]"; - - return target; -} - #if defined(_WIN32) || defined(WIN32) || defined(__OS2__) || defined(OS2) #define PREV_DIR ".." #else @@ -878,29 +760,35 @@ void IntlTest::errln( const UnicodeString &message ) /* convenience functions that include sprintf formatting */ void IntlTest::log(const char *fmt, ...) { - char buffer[300]; + char buffer[512]; va_list ap; va_start(ap, fmt); + /* sprintf it just to make sure that the information is valid */ vsprintf(buffer, fmt, ap); va_end(ap); - log(UnicodeString(buffer, "")); + if( verbose ) { + log(UnicodeString(buffer, "")); + } } void IntlTest::logln(const char *fmt, ...) { - char buffer[300]; + char buffer[512]; va_list ap; va_start(ap, fmt); + /* sprintf it just to make sure that the information is valid */ vsprintf(buffer, fmt, ap); va_end(ap); - logln(UnicodeString(buffer, "")); + if( verbose ) { + logln(UnicodeString(buffer, "")); + } } void IntlTest::err(const char *fmt, ...) { - char buffer[300]; + char buffer[512]; va_list ap; va_start(ap, fmt); @@ -911,7 +799,7 @@ void IntlTest::err(const char *fmt, ...) void IntlTest::errln(const char *fmt, ...) { - char buffer[300]; + char buffer[512]; va_list ap; va_start(ap, fmt); diff --git a/icu4c/source/test/intltest/intltest.dsp b/icu4c/source/test/intltest/intltest.dsp index 7bcf41e0c7a..4aad0bad410 100644 --- a/icu4c/source/test/intltest/intltest.dsp +++ b/icu4c/source/test/intltest/intltest.dsp @@ -133,10 +133,6 @@ SOURCE=.\cppcnvt.cpp # End Source File # Begin Source File -SOURCE=.\cputilst.cpp -# End Source File -# Begin Source File - SOURCE=.\currcoll.cpp # End Source File # Begin Source File @@ -469,10 +465,6 @@ SOURCE=.\cppcnvt.h # End Source File # Begin Source File -SOURCE=.\cputilst.h -# End Source File -# Begin Source File - SOURCE=.\currcoll.h # End Source File # Begin Source File diff --git a/icu4c/source/test/intltest/intltest.h b/icu4c/source/test/intltest/intltest.h index 8c662933c13..94afcd44cdb 100644 --- a/icu4c/source/test/intltest/intltest.h +++ b/icu4c/source/test/intltest/intltest.h @@ -12,13 +12,11 @@ #define _INTLTEST #include -#include #include "unicode/utypes.h" #include "unicode/unistr.h" -#include "unicode/coll.h" -#include "unicode/sortkey.h" -#include "unicode/fmtable.h" // liu + +class Formattable; #ifdef OS390 // avoid collision with math.h/log() @@ -137,18 +135,10 @@ protected: virtual void LL_message( UnicodeString message, UBool newline ); // used for collation result reporting, defined here for convenience - virtual void reportCResult( UnicodeString &source, UnicodeString &target, - CollationKey &sourceKey, CollationKey &targetKey, - Collator::EComparisonResult compareResult, - Collator::EComparisonResult keyResult, - Collator::EComparisonResult incResult, - Collator::EComparisonResult expectedResult ); static UnicodeString &prettify(const UnicodeString &source, UnicodeString &target); static UnicodeString prettify(const UnicodeString &source, UBool parseBackslash=FALSE); - static UnicodeString &prettify(const CollationKey &source, UnicodeString &target); static UnicodeString &appendHex(uint32_t number, int8_t digits, UnicodeString &target); - static UnicodeString &appendCompareResult(Collator::EComparisonResult result, UnicodeString &target); /* complete a relative path to a full pathname, and convert to platform-specific syntax. */ /* The character seperating directories for the relative path is '|'. */ diff --git a/icu4c/source/test/intltest/itconv.h b/icu4c/source/test/intltest/itconv.h index f5f5f5e0dfc..8f04a91e628 100644 --- a/icu4c/source/test/intltest/itconv.h +++ b/icu4c/source/test/intltest/itconv.h @@ -12,7 +12,6 @@ #define _INTLTESTCONVERT -#include "unicode/utypes.h" #include "intltest.h" diff --git a/icu4c/source/test/intltest/itercoll.h b/icu4c/source/test/intltest/itercoll.h index a521dd3c796..b60be73fd19 100644 --- a/icu4c/source/test/intltest/itercoll.h +++ b/icu4c/source/test/intltest/itercoll.h @@ -12,31 +12,11 @@ #ifndef _ITERCOLL #define _ITERCOLL -#ifndef _UTYPES -#include "unicode/utypes.h" -#endif - -#ifndef _COLL -#include "unicode/coll.h" -#endif - -#ifndef _TBLCOLL #include "unicode/tblcoll.h" -#endif - -#ifndef _COLEITR #include "unicode/coleitr.h" -#endif +#include "tscoll.h" -#ifndef _INTLTEST -#include "intltest.h" -#endif - -#ifndef _UNISTR -#include "unicode/unistr.h" -#endif - -class CollationIteratorTest: public IntlTest +class CollationIteratorTest: public IntlTestCollator { public: diff --git a/icu4c/source/test/intltest/itformat.h b/icu4c/source/test/intltest/itformat.h index c932354ab21..6c4fc717a29 100644 --- a/icu4c/source/test/intltest/itformat.h +++ b/icu4c/source/test/intltest/itformat.h @@ -12,7 +12,6 @@ #define _INTLTESTFORMAT -#include "unicode/utypes.h" #include "intltest.h" diff --git a/icu4c/source/test/intltest/itmajor.h b/icu4c/source/test/intltest/itmajor.h index caf0fd005cf..583854391ac 100644 --- a/icu4c/source/test/intltest/itmajor.h +++ b/icu4c/source/test/intltest/itmajor.h @@ -12,7 +12,6 @@ #define _INTLTESTMAJOR -#include "unicode/utypes.h" #include "intltest.h" diff --git a/icu4c/source/test/intltest/itrbbi.h b/icu4c/source/test/intltest/itrbbi.h index 576338b14ce..010d820651e 100644 --- a/icu4c/source/test/intltest/itrbbi.h +++ b/icu4c/source/test/intltest/itrbbi.h @@ -15,7 +15,6 @@ #define INTLTESTRBBI_H -#include "unicode/utypes.h" #include "intltest.h" diff --git a/icu4c/source/test/intltest/ittrans.h b/icu4c/source/test/intltest/ittrans.h index 4a4878214fa..a0bc511cade 100644 --- a/icu4c/source/test/intltest/ittrans.h +++ b/icu4c/source/test/intltest/ittrans.h @@ -15,7 +15,6 @@ #define INTLTRANSLIT_H -#include "unicode/utypes.h" #include "intltest.h" diff --git a/icu4c/source/test/intltest/ittxtbd.h b/icu4c/source/test/intltest/ittxtbd.h index c817dec9ff2..3e2691f9193 100644 --- a/icu4c/source/test/intltest/ittxtbd.h +++ b/icu4c/source/test/intltest/ittxtbd.h @@ -9,7 +9,6 @@ #define _INTLTESTTEXTBOUNDARY -#include "unicode/utypes.h" #include "intltest.h" #include "unicode/brkiter.h" diff --git a/icu4c/source/test/intltest/itutil.h b/icu4c/source/test/intltest/itutil.h index 43956010174..e2dd8e10e3c 100644 --- a/icu4c/source/test/intltest/itutil.h +++ b/icu4c/source/test/intltest/itutil.h @@ -12,7 +12,6 @@ #define _INTLTESTUTILITIES -#include "unicode/utypes.h" #include "intltest.h" diff --git a/icu4c/source/test/intltest/jacoll.h b/icu4c/source/test/intltest/jacoll.h index 7ac3db8dcf6..902abbe9d8f 100644 --- a/icu4c/source/test/intltest/jacoll.h +++ b/icu4c/source/test/intltest/jacoll.h @@ -13,19 +13,9 @@ #ifndef _JACOLL #define _JACOLL -#ifndef _UTYPES -#include "unicode/utypes.h" -#endif +#include "tscoll.h" -#ifndef _COLL -#include "unicode/coll.h" -#endif - -#ifndef _INTLTEST -#include "intltest.h" -#endif - -class CollationKanaTest: public IntlTest { +class CollationKanaTest: public IntlTestCollator { public: // If this is too small for the test data, just increase it. // Just don't make it too large, otherwise the executable will get too big diff --git a/icu4c/source/test/intltest/jahatrts.h b/icu4c/source/test/intltest/jahatrts.h index e0fa64ae7d5..59f36bbfe6f 100644 --- a/icu4c/source/test/intltest/jahatrts.h +++ b/icu4c/source/test/intltest/jahatrts.h @@ -11,7 +11,6 @@ #ifndef JAMOTOHANGTRTST_H #define JAMOTOHANGTRTST_H -#include "unicode/utypes.h" #include "unicode/translit.h" #include "unicode/jamohang.h" #include "intltest.h" diff --git a/icu4c/source/test/intltest/lcukocol.h b/icu4c/source/test/intltest/lcukocol.h index 4a4e0146c6c..b6e2800a208 100644 --- a/icu4c/source/test/intltest/lcukocol.h +++ b/icu4c/source/test/intltest/lcukocol.h @@ -5,19 +5,12 @@ ********************************************************************/ -#ifndef _UTYPES -#include "unicode/utypes.h" -#endif +#ifndef LOTUSCOLLATIONKOREANTEST_H +#define LOTUSCOLLATIONKOREANTEST_H -#ifndef _COLL -#include "unicode/coll.h" -#endif +#include "tscoll.h" -#ifndef _INTLTEST -#include "intltest.h" -#endif - -class LotusCollationKoreanTest: public IntlTest { +class LotusCollationKoreanTest: public IntlTestCollator { public: // If this is too small for the test data, just increase it. // Just don't make it too large, otherwise the executable will get too big @@ -40,3 +33,4 @@ private: Collator *myCollation; }; +#endif \ No newline at end of file diff --git a/icu4c/source/test/intltest/miscdtfm.h b/icu4c/source/test/intltest/miscdtfm.h index c7e48f076f2..2cb28b862a4 100644 --- a/icu4c/source/test/intltest/miscdtfm.h +++ b/icu4c/source/test/intltest/miscdtfm.h @@ -7,7 +7,6 @@ #ifndef _DATEFORMATMISCTEST_ #define _DATEFORMATMISCTEST_ -#include "unicode/utypes.h" #include "intltest.h" /** diff --git a/icu4c/source/test/intltest/mnkytst.h b/icu4c/source/test/intltest/mnkytst.h index 2dd91662ad4..941e2c3bbc7 100644 --- a/icu4c/source/test/intltest/mnkytst.h +++ b/icu4c/source/test/intltest/mnkytst.h @@ -14,19 +14,9 @@ #ifndef _MNKYTST #define _MNKYTST -#ifndef _UTYPES -#include "unicode/utypes.h" -#endif +#include "tscoll.h" -#ifndef _COLL -#include "unicode/coll.h" -#endif - -#ifndef _INTLTEST -#include "intltest.h" -#endif - -class CollationMonkeyTest: public IntlTest { +class CollationMonkeyTest: public IntlTestCollator { public: // If this is too small for the test data, just increase it. // Just don't make it too large, otherwise the executable will get too big diff --git a/icu4c/source/test/intltest/msfmrgts.h b/icu4c/source/test/intltest/msfmrgts.h index 02c42bcd1c2..6da158afb36 100644 --- a/icu4c/source/test/intltest/msfmrgts.h +++ b/icu4c/source/test/intltest/msfmrgts.h @@ -7,7 +7,6 @@ #ifndef _MESSAGEFORMATREGRESSIONTEST_ #define _MESSAGEFORMATREGRESSIONTEST_ -#include "unicode/utypes.h" #include "intltest.h" /** diff --git a/icu4c/source/test/intltest/nmfmapts.h b/icu4c/source/test/intltest/nmfmapts.h index 6876efcbad1..f394fd27cb9 100644 --- a/icu4c/source/test/intltest/nmfmapts.h +++ b/icu4c/source/test/intltest/nmfmapts.h @@ -8,7 +8,6 @@ #define _INTLTESTNUMBERFORMATAPI -#include "unicode/utypes.h" #include "intltest.h" diff --git a/icu4c/source/test/intltest/nmfmtrt.h b/icu4c/source/test/intltest/nmfmtrt.h index cbadae15cf1..82b8f4a3a9b 100644 --- a/icu4c/source/test/intltest/nmfmtrt.h +++ b/icu4c/source/test/intltest/nmfmtrt.h @@ -8,7 +8,6 @@ #define _NUMBERFORMATROUNDTRIPTEST_ #include -#include "unicode/utypes.h" #include "intltest.h" #include "unicode/fmtable.h" @@ -24,59 +23,59 @@ class NumberFormatRoundTripTest : public IntlTest { void runIndexedTest( int32_t index, UBool exec, const char* &name, char* par ); public: -static UBool verbose; -static UBool STRING_COMPARE; -static UBool EXACT_NUMERIC_COMPARE; -static UBool DEBUG; -static double MAX_ERROR; -static double max_numeric_error; -static double min_numeric_error; + static UBool verbose; + static UBool STRING_COMPARE; + static UBool EXACT_NUMERIC_COMPARE; + static UBool DEBUG; + static double MAX_ERROR; + static double max_numeric_error; + static double min_numeric_error; -void start(void); + void start(void); -void test(NumberFormat *fmt); -void test(NumberFormat *fmt, double value); -void test(NumberFormat *fmt, int32_t value); -void test(NumberFormat *fmt, const Formattable& value); + void test(NumberFormat *fmt); + void test(NumberFormat *fmt, double value); + void test(NumberFormat *fmt, int32_t value); + void test(NumberFormat *fmt, const Formattable& value); -static double randomDouble(double range); -static double proportionalError(const Formattable& a, const Formattable& b); -static UnicodeString& typeOf(const Formattable& n, UnicodeString& result); -static UnicodeString& escape(UnicodeString& s); + static double randomDouble(double range); + static double proportionalError(const Formattable& a, const Formattable& b); + static UnicodeString& typeOf(const Formattable& n, UnicodeString& result); + static UnicodeString& escape(UnicodeString& s); -static UBool -isDouble(const Formattable& n) -{ return (n.getType() == Formattable::kDouble); } + static inline UBool + isDouble(const Formattable& n) + { return (n.getType() == Formattable::kDouble); } -static UBool -isLong(const Formattable& n) -{ return (n.getType() == Formattable::kLong); } + static inline UBool + isLong(const Formattable& n) + { return (n.getType() == Formattable::kLong); } -/* - * Return a random uint32_t - **/ -static uint32_t randLong() -{ - // Assume 8-bit (or larger) rand values. Also assume - // that the system rand() function is very poor, which it always is. - uint32_t d; - uint32_t i; - char* poke = (char*)&d; - for (i=0; i < sizeof(uint32_t); ++i) + /* + * Return a random uint32_t + **/ + static uint32_t randLong() { - poke[i] = (char)(rand() & 0xFF); + // Assume 8-bit (or larger) rand values. Also assume + // that the system rand() function is very poor, which it always is. + uint32_t d; + uint32_t i; + char* poke = (char*)&d; + for (i=0; i < sizeof(uint32_t); ++i) + { + poke[i] = (char)(rand() & 0xFF); + } + return d; } - return d; -} -/** - * Return a random double 0 <= x < 1.0 - **/ -static double randFraction() -{ - return (double)randLong() / (double)0xFFFFFFFF; -} + /** + * Return a random double 0 <= x < 1.0 + **/ + static double randFraction() + { + return (double)randLong() / (double)0xFFFFFFFF; + } protected: UBool failure(UErrorCode status, const char* msg); diff --git a/icu4c/source/test/intltest/numfmtst.h b/icu4c/source/test/intltest/numfmtst.h index 14f433448b0..2dfc0c79da2 100644 --- a/icu4c/source/test/intltest/numfmtst.h +++ b/icu4c/source/test/intltest/numfmtst.h @@ -7,7 +7,6 @@ #ifndef _NUMBERFORMATTEST_ #define _NUMBERFORMATTEST_ -#include "unicode/utypes.h" #include "caltztst.h" class NumberFormat; class DecimalFormat; diff --git a/icu4c/source/test/intltest/numrgts.h b/icu4c/source/test/intltest/numrgts.h index dbdb25f7eb9..5ca0d938d95 100644 --- a/icu4c/source/test/intltest/numrgts.h +++ b/icu4c/source/test/intltest/numrgts.h @@ -7,9 +7,6 @@ #ifndef _NUMBERFORMATREGRESSIONTEST_ #define _NUMBERFORMATREGRESSIONTEST_ -#include "unicode/utypes.h" -#include "unicode/numfmt.h" - #include "intltest.h" #include "unicode/numfmt.h" diff --git a/icu4c/source/test/intltest/pptest.h b/icu4c/source/test/intltest/pptest.h index c3ebbc61db0..a8d652fdd41 100644 --- a/icu4c/source/test/intltest/pptest.h +++ b/icu4c/source/test/intltest/pptest.h @@ -7,7 +7,6 @@ #ifndef _PARSEPOSITIONIONTEST_ #define _PARSEPOSITIONIONTEST_ -#include "unicode/utypes.h" #include "intltest.h" diff --git a/icu4c/source/test/intltest/rbbiapts.h b/icu4c/source/test/intltest/rbbiapts.h index 738004f3917..b9627d7845a 100644 --- a/icu4c/source/test/intltest/rbbiapts.h +++ b/icu4c/source/test/intltest/rbbiapts.h @@ -14,7 +14,6 @@ #define RBBIAPITEST_H -#include "unicode/utypes.h" #include "intltest.h" #include "unicode/rbbi.h" diff --git a/icu4c/source/test/intltest/rbbitst.h b/icu4c/source/test/intltest/rbbitst.h index 326b07f5985..0c2f56e7b47 100644 --- a/icu4c/source/test/intltest/rbbitst.h +++ b/icu4c/source/test/intltest/rbbitst.h @@ -14,7 +14,6 @@ #define RBBITEST_H -#include "unicode/utypes.h" #include "intltest.h" #include "unicode/brkiter.h" diff --git a/icu4c/source/test/intltest/regcoll.h b/icu4c/source/test/intltest/regcoll.h index 49cc18f3229..41cc19124d0 100644 --- a/icu4c/source/test/intltest/regcoll.h +++ b/icu4c/source/test/intltest/regcoll.h @@ -12,27 +12,10 @@ #ifndef _REGCOLL #define _REGCOLL -#ifndef _UTYPES -#include "unicode/utypes.h" -#endif - -#ifndef _COLL -#include "unicode/coll.h" -#endif - -#ifndef _COLEITR #include "unicode/coleitr.h" -#endif +#include "tscoll.h" -#ifndef _INTLTEST -#include "intltest.h" -#endif - -#ifndef _UNISTR -#include "unicode/unistr.h" -#endif - -class CollationRegressionTest: public IntlTest +class CollationRegressionTest: public IntlTestCollator { public: diff --git a/icu4c/source/test/intltest/restest.h b/icu4c/source/test/intltest/restest.h index 5cebcb02f3b..2e92a7c9093 100644 --- a/icu4c/source/test/intltest/restest.h +++ b/icu4c/source/test/intltest/restest.h @@ -4,6 +4,9 @@ * others. All Rights Reserved. ********************************************************************/ +#ifndef RESOURCEBUNDLETEST_H +#define RESOURCEBUNDLETEST_H + #include "intltest.h" /** @@ -46,3 +49,4 @@ private: IntlTest& OUT; }; +#endif diff --git a/icu4c/source/test/intltest/restsnew.h b/icu4c/source/test/intltest/restsnew.h index 4b4d0f58a7d..0897b4672b0 100644 --- a/icu4c/source/test/intltest/restsnew.h +++ b/icu4c/source/test/intltest/restsnew.h @@ -4,6 +4,9 @@ * others. All Rights Reserved. ********************************************************************/ +#ifndef NEW_RESOURCEBUNDLETEST_H +#define NEW_RESOURCEBUNDLETEST_H + #include "intltest.h" /** @@ -50,3 +53,4 @@ private: IntlTest& OUT; }; +#endif diff --git a/icu4c/source/test/intltest/sdtfmtts.h b/icu4c/source/test/intltest/sdtfmtts.h index 13a28e9b5b7..2bc83becb4d 100644 --- a/icu4c/source/test/intltest/sdtfmtts.h +++ b/icu4c/source/test/intltest/sdtfmtts.h @@ -8,7 +8,6 @@ #define _INTLTESTSIMPLEDATEFORMATAPI -#include "unicode/utypes.h" #include "intltest.h" /** diff --git a/icu4c/source/test/intltest/sfwdchit.h b/icu4c/source/test/intltest/sfwdchit.h index 5d196603379..678b9d9c9ce 100644 --- a/icu4c/source/test/intltest/sfwdchit.h +++ b/icu4c/source/test/intltest/sfwdchit.h @@ -7,7 +7,6 @@ #ifndef SFDWCHIT_H #define SFDWCHIT_H -#include "unicode/utypes.h" #include "unicode/chariter.h" class SimpleFwdCharIterator : public ForwardCharacterIterator { diff --git a/icu4c/source/test/intltest/srchtest.h b/icu4c/source/test/intltest/srchtest.h index ad4f7429132..35ad6b1c7af 100644 --- a/icu4c/source/test/intltest/srchtest.h +++ b/icu4c/source/test/intltest/srchtest.h @@ -7,7 +7,6 @@ #ifndef _STRSRCH_H #define _STRSRCH_H -#include "unicode/utypes.h" #include "unicode/tblcoll.h" #include "unicode/brkiter.h" #include "intltest.h" diff --git a/icu4c/source/test/intltest/strtest.h b/icu4c/source/test/intltest/strtest.h index d777c256223..3864061543f 100644 --- a/icu4c/source/test/intltest/strtest.h +++ b/icu4c/source/test/intltest/strtest.h @@ -20,7 +20,6 @@ #ifndef __STRTEST_H__ #define __STRTEST_H__ -#include "unicode/utypes.h" #include "intltest.h" class StringTest : public IntlTest { diff --git a/icu4c/source/test/intltest/tchcfmt.h b/icu4c/source/test/intltest/tchcfmt.h index bdc747a0fec..92dcad02611 100644 --- a/icu4c/source/test/intltest/tchcfmt.h +++ b/icu4c/source/test/intltest/tchcfmt.h @@ -10,7 +10,6 @@ */ -#include "unicode/utypes.h" #include "intltest.h" diff --git a/icu4c/source/test/intltest/testutil.cpp b/icu4c/source/test/intltest/testutil.cpp index 1e05c0e566c..edef1a3db91 100644 --- a/icu4c/source/test/intltest/testutil.cpp +++ b/icu4c/source/test/intltest/testutil.cpp @@ -65,7 +65,7 @@ int8_t TestUtility::getBlock(UChar c) { while (block < 0) { // take care of exceptions, blocks split across 128 boundaries const Split *tuple = &gTestUtilitySplit[-block-1]; if (c < tuple->ch) - block = tuple->i1; + return tuple->i1; // Always positive or == 0 else block = tuple->i2; } diff --git a/icu4c/source/test/intltest/testutil.h b/icu4c/source/test/intltest/testutil.h index 75f5fd7f658..65def66dc4f 100644 --- a/icu4c/source/test/intltest/testutil.h +++ b/icu4c/source/test/intltest/testutil.h @@ -10,8 +10,7 @@ #ifndef TESTUTIL_H #define TESTUTIL_H -#include "unicode/utypes.h" -class UnicodeString; +#include "unicode/unistr.h" /** * Utility methods. Everything in this class is static -- do not diff --git a/icu4c/source/test/intltest/tfsmalls.h b/icu4c/source/test/intltest/tfsmalls.h index 9bc7a82575f..26f13279bb3 100644 --- a/icu4c/source/test/intltest/tfsmalls.h +++ b/icu4c/source/test/intltest/tfsmalls.h @@ -4,7 +4,10 @@ * others. All Rights Reserved. ********************************************************************/ -#include "unicode/utypes.h" + +#ifndef TESTFORMATSMALLCLASSES_H +#define TESTFORMATSMALLCLASSES_H + #include "intltest.h" /** @@ -20,3 +23,5 @@ class TestFormatSmallClasses: public IntlTest { **/ void runIndexedTest( int32_t index, UBool exec, const char* &name, char* par = NULL ); }; + +#endif diff --git a/icu4c/source/test/intltest/thcoll.cpp b/icu4c/source/test/intltest/thcoll.cpp index fd2dfc519e2..36a0b09a196 100644 --- a/icu4c/source/test/intltest/thcoll.cpp +++ b/icu4c/source/test/intltest/thcoll.cpp @@ -136,7 +136,7 @@ void CollationThaiTest::TestDictionary(void) { ++wordCount; if (wordCount <= 8) { UnicodeString str; - logln((UnicodeString)"Word " + wordCount + ": " + prettify(word, str)); + logln((UnicodeString)"Word " + wordCount + ": " + IntlTest::prettify(word, str)); } if (lastWord.length() > 0) { @@ -149,9 +149,9 @@ void CollationThaiTest::TestDictionary(void) { UnicodeString msg = UnicodeString("--------------------------------------------\n") + line - + " compare(" + prettify(lastWord, str); + + " compare(" + IntlTest::prettify(lastWord, str); msg += UnicodeString(", ") - + prettify(word, str) + ") returned " + result + + IntlTest::prettify(word, str) + ") returned " + result + ", expected -1\n"; UErrorCode status = U_ZERO_ERROR; CollationKey k1, k2; @@ -265,8 +265,8 @@ void CollationThaiTest::compareArray(const Collator& c, const char* tests[], { UnicodeString t1, t2; errln(UnicodeString("") + - i/3 + ": compare(" + prettify(s1, t1) - + " , " + prettify(s2, t2) + i/3 + ": compare(" + IntlTest::prettify(s1, t1) + + " , " + IntlTest::prettify(s2, t2) + ") got " + result + "; expected " + expect); CollationKey k1, k2; @@ -294,8 +294,8 @@ void CollationThaiTest::compareArray(const Collator& c, const char* tests[], if (sign(result) != sign(expect)) { UnicodeString t1, t2; errln(UnicodeString("") + - i/3 + ": key(" + prettify(s1, t1) - + ").compareTo(key(" + prettify(s2, t2) + i/3 + ": key(" + IntlTest::prettify(s1, t1) + + ").compareTo(key(" + IntlTest::prettify(s2, t2) + ")) got " + result + "; expected " + expect); errln((UnicodeString)" " + prettify(k1, t1) + " vs. " + prettify(k2, t2)); diff --git a/icu4c/source/test/intltest/thcoll.h b/icu4c/source/test/intltest/thcoll.h index e174eeda6ad..9c930a169bc 100644 --- a/icu4c/source/test/intltest/thcoll.h +++ b/icu4c/source/test/intltest/thcoll.h @@ -8,12 +8,12 @@ ********************************************************************** */ -#include "intltest.h" +#ifndef COLLATIONTHAITEST_H +#define COLLATIONTHAITEST_H -class Collator; -class UnicodeString; +#include "tscoll.h" -class CollationThaiTest : public IntlTest { +class CollationThaiTest : public IntlTestCollator { Collator* coll; // Thai collator public: @@ -53,3 +53,5 @@ private: UnicodeString& parseChars(UnicodeString& result, const char* chars); }; + +#endif diff --git a/icu4c/source/test/intltest/tmsgfmt.h b/icu4c/source/test/intltest/tmsgfmt.h index cd54fe3efa5..ca9d71b22a9 100644 --- a/icu4c/source/test/intltest/tmsgfmt.h +++ b/icu4c/source/test/intltest/tmsgfmt.h @@ -8,7 +8,6 @@ #ifndef _TESTMESSAGEFORMAT #define _TESTMESSAGEFORMAT -#include "unicode/utypes.h" #include "intltest.h" class Formattable; diff --git a/icu4c/source/test/intltest/transapi.cpp b/icu4c/source/test/intltest/transapi.cpp index bbaee2f145c..6c58f7b1ada 100644 --- a/icu4c/source/test/intltest/transapi.cpp +++ b/icu4c/source/test/intltest/transapi.cpp @@ -20,6 +20,7 @@ #include #include #include "unicode/rep.h" +#include "unicode/locid.h" int32_t getInt(UnicodeString str) { diff --git a/icu4c/source/test/intltest/transapi.h b/icu4c/source/test/intltest/transapi.h index f2e53e9a861..720a9e1486e 100644 --- a/icu4c/source/test/intltest/transapi.h +++ b/icu4c/source/test/intltest/transapi.h @@ -11,7 +11,6 @@ #ifndef TRANSAPI_H #define TRANSAPI_H -#include "unicode/utypes.h" #include "unicode/translit.h" #include "intltest.h" diff --git a/icu4c/source/test/intltest/transrt.cpp b/icu4c/source/test/intltest/transrt.cpp index 28e4f2df12f..338bd5fc4e0 100644 --- a/icu4c/source/test/intltest/transrt.cpp +++ b/icu4c/source/test/intltest/transrt.cpp @@ -215,125 +215,6 @@ void RTTest::test(const UnicodeString& sourceRangeVal, } } -void RTTest::test2() { - - UChar c; - UnicodeString cs, targ, reverse; - int8_t *type = new int8_t[0xFFFF]; - UParseError parseError; - UErrorCode status = U_ZERO_ERROR; - Transliterator* sourceToTarget = Transliterator::createInstance(transliteratorID, UTRANS_FORWARD, parseError, status); - if (sourceToTarget == NULL) { - log->errln("Fail: createInstance(" + transliteratorID + - ") returned NULL"); - return; - } - Transliterator* targetToSource = sourceToTarget->createInverse(status); - if (targetToSource == NULL) { - log->errln("Fail: " + transliteratorID + - ".createInverse() returned NULL"); - delete sourceToTarget; - return; - } - - log->logln("Initializing type array"); - - for (c = 0; c < 0xFFFF; ++c) { - type[c] = Unicode::getType(c); - } - - log->logln("Checking that all source characters convert to target - Singles"); - - for (c = 0; c < 0xFFFF; ++c) { - if (type[c] == Unicode::UNASSIGNED || !isSource(c)) - continue; - cs.remove(); cs.append(c); - targ = cs; - sourceToTarget->transliterate(targ); - if (!isReceivingTarget(targ)) { - logWrongScript("Source-Target", cs, targ); - if (errorCount >= errorLimit) - return; - } - } - - log->logln("Checking that all source characters convert to target - Doubles"); - - for (c = 0; c < 0xFFFF; ++c) { - if (type[c] == Unicode::UNASSIGNED || - !isSource(c)) continue; - for (UChar d = 0; d < 0xFFFF; ++d) { - if (type[d] == Unicode::UNASSIGNED || !isSource(d)) - continue; - cs.remove(); cs.append(c).append(d); - targ = cs; - sourceToTarget->transliterate(targ); - if (!isReceivingTarget(targ)) { - logWrongScript("Source-Target", cs, targ); - if (errorCount >= errorLimit) - return; - } - } - } - - log->logln("Checking that target characters convert to source and back - Singles"); - - for (c = 0; c < 0xFFFF; ++c) { - if (type[c] == Unicode::UNASSIGNED || !isTarget(c)) - continue; - cs.remove(); cs.append(c); - targ = cs; - targetToSource->transliterate(targ); - reverse = targ; - sourceToTarget->transliterate(reverse); - if (!isReceivingSource(targ)) { - logWrongScript("Target-Source", cs, targ); - if (errorCount >= errorLimit) - return; - } else if (cs != reverse) { - logRoundTripFailure(cs, targ, reverse); - if (errorCount >= errorLimit) - return; - } - } - - log->logln("Checking that target characters convert to source and back - Doubles"); - int32_t count = 0; - cs = UNICODE_STRING("aa", 2); - for (c = 0; c < 0xFFFF; ++c) { - if (type[c] == Unicode::UNASSIGNED || !isTarget(c)) - continue; - if (++count > pairLimit) { - //throw new TestTruncated("Test truncated at " + pairLimit + " x 64k pairs"); - log->logln(""); - log->logln((UnicodeString)"Test truncated at " + pairLimit + " x 64k pairs"); - return; - } - cs.setCharAt(0, c); - log->logln(TestUtility::hex(c)); - for (UChar d = 0; d < 0xFFFF; ++d) { - if (type[d] == Unicode::UNASSIGNED || !isTarget(d)) - continue; - cs.setCharAt(1, d); - targ = cs; - targetToSource->transliterate(targ); - reverse = targ; - sourceToTarget->transliterate(reverse); - if (!isReceivingSource(targ)) { - logWrongScript("Target-Source", cs, targ); - if (errorCount >= errorLimit) - return; - } else if (cs != reverse) { - logRoundTripFailure(cs, targ, reverse); - if (errorCount >= errorLimit) - return; - } - } - } - log->logln(""); - delete []type; -} - void RTTest::logWrongScript(const UnicodeString& label, const UnicodeString& from, const UnicodeString& to) { @@ -378,7 +259,7 @@ void RTTest::logRoundTripFailure(const UnicodeString& from, * Default is ASCII letters for Latin */ UBool RTTest::isSource(UChar c) { - return (TestUtility::getScript(c) == sourceScript && Unicode::isLetter(c) + return (TestUtility::getScript(c) == sourceScript && u_isalpha(c) && sourceRange.contains(c)); } @@ -398,7 +279,7 @@ RTTest::isReceivingSource(UChar c) { */ inline UBool RTTest::isTarget(UChar c) { - return (TestUtility::getScript(c) == targetScript && Unicode::isLetter(c) + return (TestUtility::getScript(c) == targetScript && u_isalpha(c) && (targetRange.isEmpty() || targetRange.contains(c))); } @@ -465,9 +346,11 @@ RTHangulTest::RTHangulTest() : RTTest("Jamo-Hangul", UBool RTHangulTest::isSource(UChar c) { - if (0x1113 <= c && c <= 0x1160) return FALSE; - if (0x1176 <= c && c <= 0x11F9) return FALSE; - if (0x3131 <= c && c <= 0x318E) return FALSE; + if ((0x1113 <= c && c <= 0x1160) + || (0x1176 <= c && c <= 0x11F9) + || (0x3131 <= c && c <= 0x318E)) { + return FALSE; + } return RTTest::isSource(c); } @@ -530,3 +413,126 @@ void TransliteratorRoundTripTest::TestCyrillic() { TestUtility::LATIN_SCRIPT, TestUtility::CYRILLIC_SCRIPT); test.test("", UnicodeString("[\\u0401\\u0410-\\u044F\\u0451]", ""), this); } + +void RTTest::test2() { + + UChar c; + UnicodeString cs, targ, reverse; + int8_t *type = new int8_t[0xFFFF]; + UParseError parseError; + UErrorCode status = U_ZERO_ERROR; + Transliterator* sourceToTarget = Transliterator::createInstance(transliteratorID, UTRANS_FORWARD, parseError, status); + if (sourceToTarget == NULL) { + log->errln("Fail: createInstance(" + transliteratorID + + ") returned NULL"); + return; + } + Transliterator* targetToSource = sourceToTarget->createInverse(status); + if (targetToSource == NULL) { + log->errln("Fail: " + transliteratorID + + ".createInverse() returned NULL"); + delete sourceToTarget; + return; + } + + log->logln("Initializing type array"); + + for (c = 0; c < 0xFFFF; ++c) { + type[c] = u_charType(c); + } + + log->logln("Checking that all source characters convert to target - Singles"); + + for (c = 0; c < 0xFFFF; ++c) { + if (type[c] == U_UNASSIGNED || !isSource(c)) + continue; + cs.remove(); + cs.append(c); + targ = cs; + sourceToTarget->transliterate(targ); + if (!isReceivingTarget(targ)) { + logWrongScript("Source-Target", cs, targ); + if (errorCount >= errorLimit) + return; + } + } + + log->logln("Checking that all source characters convert to target - Doubles"); + + for (c = 0; c < 0xFFFF; ++c) { + if (type[c] == U_UNASSIGNED || + !isSource(c)) continue; + for (UChar d = 0; d < 0xFFFF; ++d) { + if (type[d] == U_UNASSIGNED || !isSource(d)) + continue; + cs.remove(); + cs.append(c).append(d); + targ = cs; + sourceToTarget->transliterate(targ); + if (!isReceivingTarget(targ)) { + logWrongScript("Source-Target", cs, targ); + if (errorCount >= errorLimit) + return; + } + } + } + + log->logln("Checking that target characters convert to source and back - Singles"); + + for (c = 0; c < 0xFFFF; ++c) { + if (type[c] == U_UNASSIGNED || !isTarget(c)) + continue; + cs.remove(); + cs.append(c); + targ = cs; + targetToSource->transliterate(targ); + reverse = targ; + sourceToTarget->transliterate(reverse); + if (!isReceivingSource(targ)) { + logWrongScript("Target-Source", cs, targ); + if (errorCount >= errorLimit) + return; + } else if (cs != reverse) { + logRoundTripFailure(cs, targ, reverse); + if (errorCount >= errorLimit) + return; + } + } + + log->logln("Checking that target characters convert to source and back - Doubles"); + int32_t count = 0; + cs = UNICODE_STRING("aa", 2); + for (c = 0; c < 0xFFFF; ++c) { + if (type[c] == U_UNASSIGNED || !isTarget(c)) + continue; + if (++count > pairLimit) { + //throw new TestTruncated("Test truncated at " + pairLimit + " x 64k pairs"); + log->logln(""); + log->logln((UnicodeString)"Test truncated at " + pairLimit + " x 64k pairs"); + return; + } + cs.setCharAt(0, c); + log->logln(TestUtility::hex(c)); + for (UChar d = 0; d < 0xFFFF; ++d) { + if (type[d] == U_UNASSIGNED || !isTarget(d)) + continue; + cs.setCharAt(1, d); + targ = cs; + targetToSource->transliterate(targ); + reverse = targ; + sourceToTarget->transliterate(reverse); + if (!isReceivingSource(targ)) { + logWrongScript("Target-Source", cs, targ); + if (errorCount >= errorLimit) + return; + } else if (cs != reverse) { + logRoundTripFailure(cs, targ, reverse); + if (errorCount >= errorLimit) + return; + } + } + } + log->logln(""); + delete []type; +} + diff --git a/icu4c/source/test/intltest/transrt.h b/icu4c/source/test/intltest/transrt.h index 6c9a55b50d1..41c9ae67c79 100644 --- a/icu4c/source/test/intltest/transrt.h +++ b/icu4c/source/test/intltest/transrt.h @@ -10,7 +10,6 @@ #ifndef TRANSRT_H #define TRANSRT_H -#include "unicode/utypes.h" #include "intltest.h" class Transliterator; diff --git a/icu4c/source/test/intltest/transtst.h b/icu4c/source/test/intltest/transtst.h index b5a2a897fc8..c2391b33ad0 100644 --- a/icu4c/source/test/intltest/transtst.h +++ b/icu4c/source/test/intltest/transtst.h @@ -10,7 +10,6 @@ #ifndef TRANSTST_H #define TRANSTST_H -#include "unicode/utypes.h" #include "unicode/translit.h" #include "intltest.h" diff --git a/icu4c/source/test/intltest/trcoll.h b/icu4c/source/test/intltest/trcoll.h index 5daf2f5e598..cc45fd95c9c 100644 --- a/icu4c/source/test/intltest/trcoll.h +++ b/icu4c/source/test/intltest/trcoll.h @@ -13,19 +13,9 @@ #ifndef _TRCOLL #define _TRCOLL -#ifndef _UTYPES -#include "unicode/utypes.h" -#endif +#include "tscoll.h" -#ifndef _COLL -#include "unicode/coll.h" -#endif - -#ifndef _INTLTEST -#include "intltest.h" -#endif - -class CollationTurkishTest: public IntlTest { +class CollationTurkishTest: public IntlTestCollator { public: // If this is too small for the test data, just increase it. // Just don't make it too large, otherwise the executable will get too big diff --git a/icu4c/source/test/intltest/tscoll.cpp b/icu4c/source/test/intltest/tscoll.cpp index 5fbb66169f2..e374c0d0bd0 100644 --- a/icu4c/source/test/intltest/tscoll.cpp +++ b/icu4c/source/test/intltest/tscoll.cpp @@ -299,3 +299,122 @@ void IntlTestCollator::runIndexedTest( int32_t index, UBool exec, const char* &n } } +// used for collation result reporting, defined here for convenience +// (maybe moved later) +void +IntlTestCollator::reportCResult( UnicodeString &source, UnicodeString &target, + CollationKey &sourceKey, CollationKey &targetKey, + Collator::EComparisonResult compareResult, + Collator::EComparisonResult keyResult, + Collator::EComparisonResult incResult, + Collator::EComparisonResult expectedResult ) +{ + if (expectedResult < -1 || expectedResult > 1) + { + errln("***** invalid call to reportCResult ****"); + return; + } + + UBool ok1 = (compareResult == expectedResult); + UBool ok2 = (keyResult == expectedResult); + UBool ok3 = (incResult == expectedResult); + + + if (ok1 && ok2 && ok3 && !verbose) { + // Keep non-verbose, passing tests fast + return; + } else { + UnicodeString msg1(ok1 ? "Ok: compare(" : "FAIL: compare("); + UnicodeString msg2(", "), msg3(") returned "), msg4("; expected "); + UnicodeString prettySource, prettyTarget, sExpect, sResult; + + IntlTest::prettify(source, prettySource); + IntlTest::prettify(target, prettyTarget); + appendCompareResult(compareResult, sResult); + appendCompareResult(expectedResult, sExpect); + + if (ok1) { + logln(msg1 + prettySource + msg2 + prettyTarget + msg3 + sResult); + } else { + errln(msg1 + prettySource + msg2 + prettyTarget + msg3 + sResult + msg4 + sExpect); + } + + msg1 = UnicodeString(ok2 ? "Ok: key(" : "FAIL: key("); + msg2 = ").compareTo(key("; + msg3 = ")) returned "; + + appendCompareResult(keyResult, sResult); + + if (ok2) { + logln(msg1 + prettySource + msg2 + prettyTarget + msg3 + sResult); + } else { + errln(msg1 + prettySource + msg2 + prettyTarget + msg3 + sResult + msg4 + sExpect); + + msg1 = " "; + msg2 = " vs. "; + + prettify(sourceKey, prettySource); + prettify(targetKey, prettyTarget); + + errln(msg1 + prettySource + msg2 + prettyTarget); + } + msg1 = UnicodeString (ok3 ? "Ok: incCompare(" : "FAIL: incCompare("); + msg2 = ", "; + msg3 = ") returned "; + + appendCompareResult(incResult, sResult); + + if (ok3) { + logln(msg1 + prettySource + msg2 + prettyTarget + msg3 + sResult); + } else { + errln(msg1 + prettySource + msg2 + prettyTarget + msg3 + sResult + msg4 + sExpect); + } + } +} + +UnicodeString& +IntlTestCollator::appendCompareResult(Collator::EComparisonResult result, + UnicodeString& target) +{ + if (result == Collator::LESS) + { + target += "LESS"; + } + else if (result == Collator::EQUAL) + { + target += "EQUAL"; + } + else if (result == Collator::GREATER) + { + target += "GREATER"; + } + else + { + UnicodeString huh = "?"; + + target += (huh + (int32_t)result); + } + + return target; +} + +// Produce a printable representation of a CollationKey +UnicodeString &IntlTestCollator::prettify(const CollationKey &source, UnicodeString &target) +{ + int32_t i, byteCount; + const uint8_t *bytes = source.getByteArray(byteCount); + + target.remove(); + target += "["; + + for (i = 0; i < byteCount; i += 1) + { + appendHex(bytes[i], 2, target); + target += " "; + } + + target += "]"; + + return target; +} + diff --git a/icu4c/source/test/intltest/tscoll.h b/icu4c/source/test/intltest/tscoll.h index eb6d2aa17e6..98ca66adf02 100644 --- a/icu4c/source/test/intltest/tscoll.h +++ b/icu4c/source/test/intltest/tscoll.h @@ -12,12 +12,23 @@ #define _INTLTESTCOLLATOR -#include "unicode/utypes.h" #include "intltest.h" +#include "unicode/coll.h" +#include "unicode/sortkey.h" class IntlTestCollator: public IntlTest { void runIndexedTest( int32_t index, UBool exec, const char* &name, char* par = NULL ); +protected: + virtual void reportCResult( UnicodeString &source, UnicodeString &target, + CollationKey &sourceKey, CollationKey &targetKey, + Collator::EComparisonResult compareResult, + Collator::EComparisonResult keyResult, + Collator::EComparisonResult incResult, + Collator::EComparisonResult expectedResult ); + + static UnicodeString &prettify(const CollationKey &source, UnicodeString &target); + static UnicodeString &appendCompareResult(Collator::EComparisonResult result, UnicodeString &target); }; diff --git a/icu4c/source/test/intltest/tsdate.h b/icu4c/source/test/intltest/tsdate.h index 80d7fed5f8f..1db25000990 100644 --- a/icu4c/source/test/intltest/tsdate.h +++ b/icu4c/source/test/intltest/tsdate.h @@ -8,7 +8,6 @@ #define _INTLTESTDATEFORMAT -#include "unicode/utypes.h" #include "intltest.h" diff --git a/icu4c/source/test/intltest/tsdcfmsy.h b/icu4c/source/test/intltest/tsdcfmsy.h index b13bd351841..76e62b18235 100644 --- a/icu4c/source/test/intltest/tsdcfmsy.h +++ b/icu4c/source/test/intltest/tsdcfmsy.h @@ -8,7 +8,6 @@ #define _INTLTESTDECIMALFORMATSYMBOLS -#include "unicode/utypes.h" #include "intltest.h" #include "unicode/dcfmtsym.h" /** diff --git a/icu4c/source/test/intltest/tsdtfmsy.h b/icu4c/source/test/intltest/tsdtfmsy.h index b867be18058..5ea72c34f69 100644 --- a/icu4c/source/test/intltest/tsdtfmsy.h +++ b/icu4c/source/test/intltest/tsdtfmsy.h @@ -8,7 +8,6 @@ #define _INTLTESTDATEFORMATSYMBOLS -#include "unicode/utypes.h" #include "intltest.h" /** diff --git a/icu4c/source/test/intltest/tsmthred.h b/icu4c/source/test/intltest/tsmthred.h index b482574e56e..52eed01bb5b 100644 --- a/icu4c/source/test/intltest/tsmthred.h +++ b/icu4c/source/test/intltest/tsmthred.h @@ -5,6 +5,9 @@ ********************************************************************/ +#ifndef MULTITHREADTEST_H +#define MULTITHREADTEST_H + #include "intltest.h" #include "mutex.h" @@ -54,5 +57,5 @@ public: void TestThreadedIntl(void); }; - +#endif diff --git a/icu4c/source/test/intltest/tsmutex.h b/icu4c/source/test/intltest/tsmutex.h index c63174f32c6..64b567f04a6 100644 --- a/icu4c/source/test/intltest/tsmutex.h +++ b/icu4c/source/test/intltest/tsmutex.h @@ -3,13 +3,13 @@ * Copyright (c) 1997-2001, International Business Machines Corporation and * others. All Rights Reserved. ********************************************************************/ -#ifndef _INTLTEST -#include "intltest.h" -#endif -#ifndef _MUTEX + +#ifndef MUTEXTEST_H +#define MUTEXTEST_H + +#include "intltest.h" #include "mutex.h" -#endif /** * Tests Mutex and MutexImplementation functionality using @@ -35,5 +35,5 @@ public: private: }; - +#endif diff --git a/icu4c/source/test/intltest/tsnmfmt.h b/icu4c/source/test/intltest/tsnmfmt.h index 4eb3e9e3a91..f2ee6b9a7fa 100644 --- a/icu4c/source/test/intltest/tsnmfmt.h +++ b/icu4c/source/test/intltest/tsnmfmt.h @@ -10,10 +10,10 @@ #include -#include "unicode/utypes.h" #include "intltest.h" #include "unicode/fmtable.h" +#include "unicode/locid.h" class NumberFormat; diff --git a/icu4c/source/test/intltest/tsputil.h b/icu4c/source/test/intltest/tsputil.h index 30f72aa8cbd..21536b43b3d 100644 --- a/icu4c/source/test/intltest/tsputil.h +++ b/icu4c/source/test/intltest/tsputil.h @@ -8,7 +8,6 @@ #ifndef _PUTILTEST_ #define _PUTILTEST_ -#include "unicode/utypes.h" #include "intltest.h" /** diff --git a/icu4c/source/test/intltest/tstnorm.h b/icu4c/source/test/intltest/tstnorm.h index 2674230aeb1..620bee53a7b 100644 --- a/icu4c/source/test/intltest/tstnorm.h +++ b/icu4c/source/test/intltest/tstnorm.h @@ -11,21 +11,8 @@ #ifndef _TSTNORM #define _TSTNORM -#ifndef _UTYPES -#include "unicode/utypes.h" -#endif - -#ifndef _COLL -#include "unicode/coll.h" -#endif - -#ifndef _NORMLZR #include "unicode/normlzr.h" -#endif - -#ifndef _INTLTEST #include "intltest.h" -#endif class BasicNormalizerTest : public IntlTest { public: diff --git a/icu4c/source/test/intltest/tzregts.h b/icu4c/source/test/intltest/tzregts.h index e917869e8ee..c08d67bb66f 100644 --- a/icu4c/source/test/intltest/tzregts.h +++ b/icu4c/source/test/intltest/tzregts.h @@ -7,7 +7,6 @@ #ifndef _TIMEZONEREGRESSIONTEST_ #define _TIMEZONEREGRESSIONTEST_ -#include "unicode/utypes.h" #include "unicode/timezone.h" #include "intltest.h" diff --git a/icu4c/source/test/intltest/tztest.h b/icu4c/source/test/intltest/tztest.h index 61b052f31a2..4041f5618ce 100644 --- a/icu4c/source/test/intltest/tztest.h +++ b/icu4c/source/test/intltest/tztest.h @@ -8,7 +8,6 @@ #ifndef __TimeZoneTest__ #define __TimeZoneTest__ -#include "unicode/utypes.h" #include "caltztst.h" class SimpleTimeZone; diff --git a/icu4c/source/test/intltest/ufltlgts.h b/icu4c/source/test/intltest/ufltlgts.h index 598f02e9c1f..9459d5620cc 100644 --- a/icu4c/source/test/intltest/ufltlgts.h +++ b/icu4c/source/test/intltest/ufltlgts.h @@ -11,7 +11,6 @@ #ifndef UNIFLTLOGICTST_H #define UNIFLTLOGICTST_H -#include "unicode/utypes.h" #include "unicode/translit.h" #include "unicode/unifltlg.h" #include "intltest.h" diff --git a/icu4c/source/test/intltest/unhxtrts.h b/icu4c/source/test/intltest/unhxtrts.h index 634b0ff69d9..4211240581f 100644 --- a/icu4c/source/test/intltest/unhxtrts.h +++ b/icu4c/source/test/intltest/unhxtrts.h @@ -11,7 +11,6 @@ #ifndef UNITOHEXTRTST_H #define UNITOHEXTRTST_H -#include "unicode/utypes.h" #include "unicode/translit.h" #include "unicode/unitohex.h" #include "intltest.h" diff --git a/icu4c/source/test/intltest/usettest.h b/icu4c/source/test/intltest/usettest.h index 078bb94e836..0b1c308e74f 100644 --- a/icu4c/source/test/intltest/usettest.h +++ b/icu4c/source/test/intltest/usettest.h @@ -14,7 +14,6 @@ #ifndef _TESTUNISET #define _TESTUNISET -#include "unicode/utypes.h" #include "intltest.h" class UnicodeSet; diff --git a/icu4c/source/test/intltest/ustrtest.h b/icu4c/source/test/intltest/ustrtest.h index 781f61a17c7..c6587b81df5 100644 --- a/icu4c/source/test/intltest/ustrtest.h +++ b/icu4c/source/test/intltest/ustrtest.h @@ -4,6 +4,9 @@ * others. All Rights Reserved. ********************************************************************/ +#ifndef UNICODESTRINGTEST_H +#define UNICODESTRINGTEST_H + #include "intltest.h" /** @@ -74,3 +77,4 @@ public: void TestUnescape(void); }; +#endif