1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 /********************************************************************
5 * Copyright (c) 1998-2016, International Business Machines Corporation and
6 * others. All Rights Reserved.
7 ********************************************************************/
10 * MajorTestLevel is the top level test class for everything in the directory "IntlWork".
13 /***********************************************************************
14 * Modification history
15 * Date Name Description
16 * 02/14/2001 synwee Release collation for testing.
17 ***********************************************************************/
19 #include "unicode/utypes.h"
20 #include "unicode/localpointer.h"
41 extern IntlTest
*createBiDiConformanceTest();
43 #define CASE_SUITE(id, suite) case id: \
46 logln(#suite "---"); \
48 callTest(test, par); \
52 void MajorTestLevel::runIndexedTest( int32_t index
, UBool exec
, const char* &name
, char* par
)
55 case 0: name
= "utility";
57 logln("TestSuite Utilities---"); logln();
58 IntlTestUtilities test
;
59 callTest( test
, par
);
63 case 1: name
= "normalize";
64 #if !UCONFIG_NO_NORMALIZATION
66 logln("TestSuite Normalize---"); logln();
67 IntlTestNormalize test
;
68 callTest( test
, par
);
73 case 2: name
= "collate";
74 #if !UCONFIG_NO_COLLATION
76 logln("TestSuite Collator---"); logln();
77 IntlTestCollator test
;
78 callTest( test
, par
);
83 case 3: name
= "regex";
84 #if !UCONFIG_NO_REGULAR_EXPRESSIONS
86 logln("TestSuite Regex---"); logln();
88 callTest( test
, par
);
93 case 4: name
= "format";
94 #if !UCONFIG_NO_FORMATTING
96 logln("TestSuite Format---"); logln();
98 callTest( test
, par
);
103 case 5: name
= "translit";
104 #if !UCONFIG_NO_TRANSLITERATION
106 logln("TestSuite Transliterator---"); logln();
107 IntlTestTransliterator test
;
108 callTest( test
, par
);
113 case 6: name
= "rbbi";
114 #if !UCONFIG_NO_BREAK_ITERATION && !UCONFIG_NO_REGULAR_EXPRESSIONS
116 logln("TestSuite RuleBasedBreakIterator---"); logln();
118 callTest( test
, par
);
122 case 7: name
= "rbnf";
123 #if !UCONFIG_NO_FORMATTING
125 logln("TestSuite RuleBasedNumberFormat----"); logln();
131 case 8: name
= "rbnfrt";
132 #if !UCONFIG_NO_FORMATTING
134 logln("TestSuite RuleBasedNumberFormat RT----"); logln();
135 RbnfRoundTripTest test
;
141 case 9: name
= "icuserv";
142 #if !UCONFIG_NO_SERVICE
144 logln("TestSuite ICUService---"); logln();
150 case 10: name
= "idna";
151 #if !UCONFIG_NO_IDNA && !UCONFIG_NO_TRANSLITERATION
153 logln("TestSuite IDNA----"); logln();
159 case 11: name
= "convert";
160 #if !UCONFIG_NO_LEGACY_CONVERSION
162 logln("TestSuite Conversion---"); logln();
164 callTest( test
, par
);
169 case 12: name
= "rbnfp";
170 #if !UCONFIG_NO_FORMATTING
172 logln("TestSuite RuleBasedNumberParse ----"); logln();
173 IntlTestRBNFParse test
;
179 case 13: name
= "csdet";
181 logln("TestSuite CharsetDetection---"); logln();
182 CharsetDetectionTest test
;
189 #if !UCONFIG_NO_REGULAR_EXPRESSIONS && !UCONFIG_NO_NORMALIZATION && !UCONFIG_NO_FILE_IO
192 logln("TestSuite SpoofDetection---"); logln();
201 case 15: name
= "bidi";
203 logln("TestSuite bidi---"); logln();
204 LocalPointer
<IntlTest
> test(createBiDiConformanceTest());
205 callTest(*test
, par
);
210 default: name
= ""; break;
216 void IntlTestNormalize::runIndexedTest( int32_t index
, UBool exec
, const char* &name
, char* par
)
218 if(exec
) logln("TestSuite Normalize:");
219 #if UCONFIG_NO_NORMALIZATION
223 CASE_SUITE(0, BasicNormalizerTest
);
224 CASE_SUITE(1, NormalizerConformanceTest
); // this takes a long time
225 CASE_SUITE(2, CanonicalIteratorTest
);