1 /********************************************************************
3 * Copyright (c) 1998-2009, International Business Machines Corporation and
4 * others. All Rights Reserved.
5 ********************************************************************/
8 * MajorTestLevel is the top level test class for everything in the directory "IntlWork".
11 /***********************************************************************
12 * Modification history
13 * Date Name Description
14 * 02/14/2001 synwee Release collation for testing.
15 ***********************************************************************/
17 #include "unicode/utypes.h"
18 #include "unicode/localpointer.h"
39 extern IntlTest
*createBiDiConformanceTest();
41 #define CASE_SUITE(id, suite) case id: \
44 logln(#suite "---"); \
46 callTest(test, par); \
50 void MajorTestLevel::runIndexedTest( int32_t index
, UBool exec
, const char* &name
, char* par
)
53 case 0: name
= "utility";
55 logln("TestSuite Utilities---"); logln();
56 IntlTestUtilities test
;
57 callTest( test
, par
);
61 case 1: name
= "normalize";
62 #if !UCONFIG_NO_NORMALIZATION
64 logln("TestSuite Normalize---"); logln();
65 IntlTestNormalize test
;
66 callTest( test
, par
);
71 case 2: name
= "collate";
72 #if !UCONFIG_NO_COLLATION
74 logln("TestSuite Collator---"); logln();
75 IntlTestCollator test
;
76 callTest( test
, par
);
81 case 3: name
= "regex";
82 #if !UCONFIG_NO_REGULAR_EXPRESSIONS
84 logln("TestSuite Regex---"); logln();
86 callTest( test
, par
);
91 case 4: name
= "format";
92 #if !UCONFIG_NO_FORMATTING
94 logln("TestSuite Format---"); logln();
96 callTest( test
, par
);
101 case 5: name
= "translit";
102 #if !UCONFIG_NO_TRANSLITERATION
104 logln("TestSuite Transliterator---"); logln();
105 IntlTestTransliterator test
;
106 callTest( test
, par
);
111 case 6: name
= "rbbi";
112 #if !UCONFIG_NO_BREAK_ITERATION
114 logln("TestSuite RuleBasedBreakIterator---"); logln();
116 callTest( test
, par
);
120 case 7: name
= "rbnf";
121 #if !UCONFIG_NO_FORMATTING
123 logln("TestSuite RuleBasedNumberFormat----"); logln();
129 case 8: name
= "rbnfrt";
130 #if !UCONFIG_NO_FORMATTING
132 logln("TestSuite RuleBasedNumberFormat RT----"); logln();
133 RbnfRoundTripTest test
;
139 case 9: name
= "icuserv";
140 #if !UCONFIG_NO_SERVICE
142 logln("TestSuite ICUService---"); logln();
148 case 10: name
= "idna";
149 #if !UCONFIG_NO_IDNA && !UCONFIG_NO_TRANSLITERATION
151 logln("TestSuite IDNA----"); logln();
157 case 11: name
= "convert";
158 #if !UCONFIG_NO_LEGACY_CONVERSION
160 logln("TestSuite Conversion---"); logln();
162 callTest( test
, par
);
167 case 12: name
= "rbnfp";
168 #if !UCONFIG_NO_FORMATTING
170 logln("TestSuite RuleBasedNumberParse ----"); logln();
171 IntlTestRBNFParse test
;
177 case 13: name
= "csdet";
179 logln("TestSuite CharsetDetection---"); logln();
180 CharsetDetectionTest test
;
187 #if !UCONFIG_NO_REGULAR_EXPRESSIONS && !UCONFIG_NO_NORMALIZATION && !UCONFIG_NO_FILE_IO
190 logln("TestSuite SpoofDetection---"); logln();
199 case 15: name
= "bidi";
201 logln("TestSuite bidi---"); logln();
202 LocalPointer
<IntlTest
> test(createBiDiConformanceTest());
203 callTest(*test
, par
);
208 default: name
= ""; break;
214 void IntlTestNormalize::runIndexedTest( int32_t index
, UBool exec
, const char* &name
, char* par
)
216 if(exec
) logln("TestSuite Normalize:");
217 #if UCONFIG_NO_NORMALIZATION
221 CASE_SUITE(0, BasicNormalizerTest
);
222 CASE_SUITE(1, NormalizerConformanceTest
); // this takes a long time
223 CASE_SUITE(2, CanonicalIteratorTest
);