2000-03-10 00:42:27 +00:00
|
|
|
/********************************************************************
|
2002-08-27 19:10:11 +00:00
|
|
|
* COPYRIGHT:
|
2001-03-21 20:09:56 +00:00
|
|
|
* Copyright (c) 1998-2001, 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"
|
1999-08-16 21:50:52 +00:00
|
|
|
#include "itmajor.h"
|
|
|
|
|
|
|
|
#include "itutil.h"
|
|
|
|
#include "tscoll.h"
|
|
|
|
#include "itformat.h"
|
2003-02-26 23:22:03 +00:00
|
|
|
//%#include "itconv.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"
|
|
|
|
#include "itrbnfrt.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"
|
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";
|
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 );
|
|
|
|
}
|
|
|
|
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-02-28 21:37:55 +00:00
|
|
|
if(exec){
|
|
|
|
logln("TestSuite IDNA----"); logln();
|
|
|
|
TestIDNA test;
|
|
|
|
callTest(test,par);
|
|
|
|
}
|
|
|
|
break;
|
1999-08-16 21:50:52 +00:00
|
|
|
default: name = ""; break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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:");
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|