2000-03-10 00:42:27 +00:00
|
|
|
/********************************************************************
|
2002-08-27 19:10:11 +00:00
|
|
|
* COPYRIGHT:
|
2009-04-01 23:46:14 +00:00
|
|
|
* Copyright (c) 1998-2009, International Business Machines Corporation and
|
2000-03-10 00:42:27 +00:00
|
|
|
* others. All Rights Reserved.
|
|
|
|
********************************************************************/
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* MajorTestLevel is the top level test class for everything in the directory "IntlWork".
|
|
|
|
*/
|
|
|
|
|
2001-02-15 01:44:15 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* Modification history
|
|
|
|
* Date Name Description
|
|
|
|
* 02/14/2001 synwee Release collation for testing.
|
|
|
|
***********************************************************************/
|
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
#include "unicode/utypes.h"
|
2009-11-20 23:28:47 +00:00
|
|
|
#include "unicode/localpointer.h"
|
1999-08-16 21:50:52 +00:00
|
|
|
#include "itmajor.h"
|
|
|
|
|
|
|
|
#include "itutil.h"
|
|
|
|
#include "tscoll.h"
|
|
|
|
#include "itformat.h"
|
2000-01-18 02:35:52 +00:00
|
|
|
#include "ittrans.h"
|
2000-01-15 01:56:11 +00:00
|
|
|
#include "itrbbi.h"
|
2001-10-10 21:43:11 +00:00
|
|
|
#include "itrbnf.h"
|
2004-04-09 19:58:58 +00:00
|
|
|
#include "itrbnfp.h"
|
2001-10-10 21:43:11 +00:00
|
|
|
#include "itrbnfrt.h"
|
2009-04-01 23:46:14 +00:00
|
|
|
#include "itspoof.h"
|
2001-08-31 23:01:58 +00:00
|
|
|
#include "normconf.h"
|
2002-10-22 00:09:32 +00:00
|
|
|
#include "regextst.h"
|
2001-08-31 23:01:58 +00:00
|
|
|
#include "tstnorm.h"
|
2002-03-19 07:18:07 +00:00
|
|
|
#include "canittst.h"
|
2002-11-06 22:14:49 +00:00
|
|
|
#include "icusvtst.h"
|
2003-02-28 21:37:55 +00:00
|
|
|
#include "testidna.h"
|
2003-07-22 04:18:20 +00:00
|
|
|
#include "convtest.h"
|
2006-02-06 18:03:11 +00:00
|
|
|
#include "csdetest.h"
|
2003-07-22 04:18:20 +00:00
|
|
|
|
2009-11-13 19:25:21 +00:00
|
|
|
extern IntlTest *createBiDiConformanceTest();
|
|
|
|
|
2001-08-31 23:01:58 +00:00
|
|
|
#define CASE_SUITE(id, suite) case id: \
|
|
|
|
name = #suite; \
|
|
|
|
if(exec) { \
|
|
|
|
logln(#suite "---"); \
|
|
|
|
suite test; \
|
|
|
|
callTest(test, par); \
|
|
|
|
} \
|
|
|
|
break
|
1999-08-16 21:50:52 +00:00
|
|
|
|
2000-08-14 21:42:36 +00:00
|
|
|
void MajorTestLevel::runIndexedTest( int32_t index, UBool exec, const char* &name, char* par )
|
1999-08-16 21:50:52 +00:00
|
|
|
{
|
|
|
|
switch (index) {
|
2002-08-27 19:10:11 +00:00
|
|
|
case 0: name = "utility";
|
|
|
|
if (exec) {
|
1999-08-16 21:50:52 +00:00
|
|
|
logln("TestSuite Utilities---"); logln();
|
|
|
|
IntlTestUtilities test;
|
|
|
|
callTest( test, par );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2002-08-27 19:10:11 +00:00
|
|
|
case 1: name = "normalize";
|
2003-05-06 01:22:23 +00:00
|
|
|
#if !UCONFIG_NO_NORMALIZATION
|
1999-08-16 21:50:52 +00:00
|
|
|
if (exec) {
|
2001-08-31 23:01:58 +00:00
|
|
|
logln("TestSuite Normalize---"); logln();
|
|
|
|
IntlTestNormalize test;
|
1999-08-16 21:50:52 +00:00
|
|
|
callTest( test, par );
|
|
|
|
}
|
2003-05-06 01:22:23 +00:00
|
|
|
#endif
|
1999-08-16 21:50:52 +00:00
|
|
|
break;
|
|
|
|
|
2002-08-27 19:10:11 +00:00
|
|
|
case 2: name = "collate";
|
2002-09-21 00:43:14 +00:00
|
|
|
#if !UCONFIG_NO_COLLATION
|
1999-08-16 21:50:52 +00:00
|
|
|
if (exec) {
|
2001-08-31 23:01:58 +00:00
|
|
|
logln("TestSuite Collator---"); logln();
|
|
|
|
IntlTestCollator test;
|
1999-08-16 21:50:52 +00:00
|
|
|
callTest( test, par );
|
|
|
|
}
|
2002-09-21 00:43:14 +00:00
|
|
|
#endif
|
1999-08-16 21:50:52 +00:00
|
|
|
break;
|
|
|
|
|
2002-10-22 00:09:32 +00:00
|
|
|
case 3: name = "regex";
|
2002-11-07 02:34:46 +00:00
|
|
|
#if !UCONFIG_NO_REGULAR_EXPRESSIONS
|
2002-10-22 00:09:32 +00:00
|
|
|
if (exec) {
|
|
|
|
logln("TestSuite Regex---"); logln();
|
|
|
|
RegexTest test;
|
|
|
|
callTest( test, par );
|
|
|
|
}
|
2002-11-07 02:34:46 +00:00
|
|
|
#endif
|
1999-08-16 21:50:52 +00:00
|
|
|
break;
|
|
|
|
|
2002-08-27 19:10:11 +00:00
|
|
|
case 4: name = "format";
|
2002-09-21 00:43:14 +00:00
|
|
|
#if !UCONFIG_NO_FORMATTING
|
1999-11-22 17:16:10 +00:00
|
|
|
if (exec) {
|
2001-08-31 23:01:58 +00:00
|
|
|
logln("TestSuite Format---"); logln();
|
|
|
|
IntlTestFormat test;
|
|
|
|
callTest( test, par );
|
|
|
|
}
|
2002-09-21 00:43:14 +00:00
|
|
|
#endif
|
2001-08-31 23:01:58 +00:00
|
|
|
break;
|
|
|
|
|
2002-08-27 19:10:11 +00:00
|
|
|
case 5: name = "translit";
|
2002-09-21 00:43:14 +00:00
|
|
|
#if !UCONFIG_NO_TRANSLITERATION
|
2001-08-31 23:01:58 +00:00
|
|
|
if (exec) {
|
|
|
|
logln("TestSuite Transliterator---"); logln();
|
2000-01-18 02:35:52 +00:00
|
|
|
IntlTestTransliterator test;
|
1999-11-22 17:16:10 +00:00
|
|
|
callTest( test, par );
|
|
|
|
}
|
2002-09-21 00:43:14 +00:00
|
|
|
#endif
|
1999-11-22 17:16:10 +00:00
|
|
|
break;
|
2001-08-31 23:01:58 +00:00
|
|
|
|
2002-08-27 19:10:11 +00:00
|
|
|
case 6: name = "rbbi";
|
2002-09-21 00:43:14 +00:00
|
|
|
#if !UCONFIG_NO_BREAK_ITERATION
|
2000-01-15 01:56:11 +00:00
|
|
|
if (exec) {
|
2001-08-31 23:01:58 +00:00
|
|
|
logln("TestSuite RuleBasedBreakIterator---"); logln();
|
2000-01-15 01:56:11 +00:00
|
|
|
IntlTestRBBI test;
|
|
|
|
callTest( test, par );
|
|
|
|
}
|
2002-09-21 00:43:14 +00:00
|
|
|
#endif
|
2000-01-15 01:56:11 +00:00
|
|
|
break;
|
2002-08-21 19:09:33 +00:00
|
|
|
case 7: name = "rbnf";
|
2002-09-21 00:43:14 +00:00
|
|
|
#if !UCONFIG_NO_FORMATTING
|
2002-08-21 19:09:33 +00:00
|
|
|
if (exec) {
|
2002-04-02 02:55:31 +00:00
|
|
|
logln("TestSuite RuleBasedNumberFormat----"); logln();
|
|
|
|
IntlTestRBNF test;
|
|
|
|
callTest(test, par);
|
2002-08-21 19:09:33 +00:00
|
|
|
}
|
2002-09-21 00:43:14 +00:00
|
|
|
#endif
|
2002-08-21 19:09:33 +00:00
|
|
|
break;
|
|
|
|
case 8: name = "rbnfrt";
|
2002-09-21 00:43:14 +00:00
|
|
|
#if !UCONFIG_NO_FORMATTING
|
2002-08-21 19:09:33 +00:00
|
|
|
if (exec) {
|
2002-04-02 02:55:31 +00:00
|
|
|
logln("TestSuite RuleBasedNumberFormat RT----"); logln();
|
|
|
|
RbnfRoundTripTest test;
|
|
|
|
callTest(test, par);
|
2002-08-21 19:09:33 +00:00
|
|
|
}
|
2002-09-21 00:43:14 +00:00
|
|
|
#endif
|
2002-08-21 19:09:33 +00:00
|
|
|
break;
|
|
|
|
|
2003-02-26 23:22:03 +00:00
|
|
|
case 9: name = "icuserv";
|
2002-11-06 22:14:49 +00:00
|
|
|
#if !UCONFIG_NO_SERVICE
|
|
|
|
if (exec) {
|
|
|
|
logln("TestSuite ICUService---"); logln();
|
|
|
|
ICUServiceTest test;
|
|
|
|
callTest(test, par);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
break;
|
2003-03-14 21:39:33 +00:00
|
|
|
case 10: name = "idna";
|
2003-05-29 01:15:29 +00:00
|
|
|
#if !UCONFIG_NO_IDNA && !UCONFIG_NO_TRANSLITERATION
|
2003-02-28 21:37:55 +00:00
|
|
|
if(exec){
|
|
|
|
logln("TestSuite IDNA----"); logln();
|
|
|
|
TestIDNA test;
|
|
|
|
callTest(test,par);
|
|
|
|
}
|
2003-05-06 01:22:23 +00:00
|
|
|
#endif
|
2003-02-28 21:37:55 +00:00
|
|
|
break;
|
2003-08-19 21:08:26 +00:00
|
|
|
case 11: name = "convert";
|
2003-12-11 17:40:28 +00:00
|
|
|
#if !UCONFIG_NO_LEGACY_CONVERSION
|
2003-07-22 04:18:20 +00:00
|
|
|
if (exec) {
|
|
|
|
logln("TestSuite Conversion---"); logln();
|
|
|
|
ConversionTest test;
|
|
|
|
callTest( test, par );
|
|
|
|
}
|
2003-12-11 17:40:28 +00:00
|
|
|
#endif
|
2003-07-22 04:18:20 +00:00
|
|
|
break;
|
|
|
|
|
2004-04-09 19:58:58 +00:00
|
|
|
case 12: name = "rbnfp";
|
|
|
|
#if !UCONFIG_NO_FORMATTING
|
|
|
|
if (exec) {
|
|
|
|
logln("TestSuite RuleBasedNumberParse ----"); logln();
|
|
|
|
IntlTestRBNFParse test;
|
|
|
|
callTest(test, par);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
break;
|
|
|
|
|
2006-02-06 18:03:11 +00:00
|
|
|
case 13: name = "csdet";
|
|
|
|
if (exec) {
|
|
|
|
logln("TestSuite CharsetDetection---"); logln();
|
|
|
|
CharsetDetectionTest test;
|
|
|
|
callTest(test, par);
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
2009-08-04 21:09:17 +00:00
|
|
|
case 14:
|
|
|
|
#if !UCONFIG_NO_REGULAR_EXPRESSIONS && !UCONFIG_NO_NORMALIZATION && !UCONFIG_NO_FILE_IO
|
|
|
|
name = "spoof";
|
2009-04-01 23:46:14 +00:00
|
|
|
if (exec) {
|
|
|
|
logln("TestSuite SpoofDetection---"); logln();
|
|
|
|
IntlTestSpoof test;
|
|
|
|
callTest(test, par);
|
|
|
|
}
|
2009-08-04 21:09:17 +00:00
|
|
|
#else
|
|
|
|
name = "skip";
|
2009-05-04 05:45:27 +00:00
|
|
|
#endif
|
2009-04-01 23:46:14 +00:00
|
|
|
break;
|
|
|
|
|
2009-11-13 19:25:21 +00:00
|
|
|
case 15: name = "bidi";
|
|
|
|
if (exec) {
|
|
|
|
logln("TestSuite bidi---"); logln();
|
2009-11-20 23:28:47 +00:00
|
|
|
LocalPointer<IntlTest> test(createBiDiConformanceTest());
|
2009-11-13 19:25:21 +00:00
|
|
|
callTest(*test, par);
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
1999-08-16 21:50:52 +00:00
|
|
|
default: name = ""; break;
|
|
|
|
}
|
2004-04-09 19:58:58 +00:00
|
|
|
|
|
|
|
|
1999-08-16 21:50:52 +00:00
|
|
|
}
|
|
|
|
|
2001-08-31 23:01:58 +00:00
|
|
|
void IntlTestNormalize::runIndexedTest( int32_t index, UBool exec, const char* &name, char* par )
|
|
|
|
{
|
|
|
|
if(exec) logln("TestSuite Normalize:");
|
2003-05-06 01:22:23 +00:00
|
|
|
#if UCONFIG_NO_NORMALIZATION
|
|
|
|
name="";
|
|
|
|
#else
|
2001-08-31 23:01:58 +00:00
|
|
|
switch (index) {
|
2001-09-11 01:28:07 +00:00
|
|
|
CASE_SUITE(0, BasicNormalizerTest);
|
|
|
|
CASE_SUITE(1, NormalizerConformanceTest); // this takes a long time
|
2002-03-19 07:18:07 +00:00
|
|
|
CASE_SUITE(2, CanonicalIteratorTest);
|
2001-08-31 23:01:58 +00:00
|
|
|
default:
|
|
|
|
name="";
|
|
|
|
break;
|
|
|
|
}
|
2003-05-06 01:22:23 +00:00
|
|
|
#endif
|
2001-08-31 23:01:58 +00:00
|
|
|
}
|