~ubuntu-branches/ubuntu/gutsy/icu/gutsy-updates

« back to all changes in this revision

Viewing changes to source/test/intltest/itmajor.cpp

  • Committer: Package Import Robot
  • Author(s): Jay Berkenbilt
  • Date: 2005-11-19 11:29:31 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20051119112931-vcizkrp10tli4enw
Tags: 3.4-3
Explicitly build with g++ 3.4.  The current ICU fails its test suite
with 4.0 but not with 3.4.  Future versions should work properly with
4.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/********************************************************************
2
 
 * COPYRIGHT: 
3
 
 * Copyright (c) 1998-2001, International Business Machines Corporation and
4
 
 * others. All Rights Reserved.
5
 
 ********************************************************************/
6
 
 
7
 
/**
8
 
 * MajorTestLevel is the top level test class for everything in the directory "IntlWork".
9
 
 */
10
 
 
11
 
/***********************************************************************
12
 
* Modification history
13
 
* Date        Name        Description
14
 
* 02/14/2001  synwee      Release collation for testing.
15
 
***********************************************************************/
16
 
 
17
 
#include "unicode/utypes.h"
18
 
#include "itmajor.h"
19
 
 
20
 
#include "itutil.h"
21
 
#include "tscoll.h"
22
 
#include "ittxtbd.h"
23
 
#include "itformat.h"
24
 
#include "itconv.h"
25
 
#include "ittrans.h"
26
 
#include "itrbbi.h"
27
 
#include "itrbnf.h"
28
 
#include "itrbnfrt.h"
29
 
#include "normconf.h"
30
 
#include "tstnorm.h"
31
 
#include "canittst.h"
32
 
 
33
 
#define CASE_SUITE(id, suite) case id:                  \
34
 
                          name = #suite;                \
35
 
                          if(exec) {                    \
36
 
                              logln(#suite "---");      \
37
 
                              suite test;               \
38
 
                              callTest(test, par);      \
39
 
                          }                             \
40
 
                          break
41
 
 
42
 
void MajorTestLevel::runIndexedTest( int32_t index, UBool exec, const char* &name, char* par )
43
 
{
44
 
    switch (index) {
45
 
        case 0: name = "utility"; 
46
 
                if (exec) { 
47
 
                    logln("TestSuite Utilities---"); logln();
48
 
                    IntlTestUtilities test;
49
 
                    callTest( test, par );
50
 
                }
51
 
                break;
52
 
 
53
 
        case 1: name = "convert"; 
54
 
                if (exec) {
55
 
                    logln("TestSuite Convert---"); logln();
56
 
                    IntlTestConvert test;
57
 
                    callTest( test, par );
58
 
                }
59
 
                break;
60
 
 
61
 
        case 2: name = "normalize"; 
62
 
                if (exec) {
63
 
                    logln("TestSuite Normalize---"); logln();
64
 
                    IntlTestNormalize test;
65
 
                    callTest( test, par );
66
 
                }
67
 
                break;
68
 
 
69
 
        case 3: name = "collate"; 
70
 
                if (exec) {
71
 
                    logln("TestSuite Collator---"); logln();
72
 
                    IntlTestCollator test;
73
 
                    callTest( test, par );
74
 
                }
75
 
                break;
76
 
 
77
 
        case 4: name = "textbounds"; 
78
 
                if (exec) {
79
 
                    logln("TestSuite TextBoundary---"); logln();
80
 
                    IntlTestTextBoundary test;
81
 
                    callTest( test, par );
82
 
                }
83
 
                break;
84
 
 
85
 
        case 5: name = "format"; 
86
 
                if (exec) {
87
 
                    logln("TestSuite Format---"); logln();
88
 
                    IntlTestFormat test;
89
 
                    callTest( test, par );
90
 
                }
91
 
                break;
92
 
 
93
 
        case 6: name = "translit"; 
94
 
                if (exec) {
95
 
                    logln("TestSuite Transliterator---"); logln();
96
 
                    IntlTestTransliterator test;
97
 
                    callTest( test, par );
98
 
                }
99
 
                break;
100
 
 
101
 
        case 7: name = "rbbi"; 
102
 
                if (exec) {
103
 
                    logln("TestSuite RuleBasedBreakIterator---"); logln();
104
 
                    IntlTestRBBI test;
105
 
                    callTest( test, par );
106
 
                }
107
 
                break;
108
 
        case 8: name = "rbnf";
109
 
            if (exec) {
110
 
                    logln("TestSuite RuleBasedNumberFormat----"); logln();
111
 
                    IntlTestRBNF test;
112
 
                    callTest(test, par);
113
 
            }
114
 
            break;
115
 
        case 9: name = "rbnfrt";
116
 
            if (exec) {
117
 
                    logln("TestSuite RuleBasedNumberFormat RT----"); logln();
118
 
                    RbnfRoundTripTest test;
119
 
                    callTest(test, par);
120
 
            }
121
 
            break;
122
 
 
123
 
        default: name = ""; break;
124
 
    }
125
 
}
126
 
 
127
 
void IntlTestNormalize::runIndexedTest( int32_t index, UBool exec, const char* &name, char* par )
128
 
{
129
 
    if(exec) logln("TestSuite Normalize:");
130
 
    switch (index) {
131
 
        CASE_SUITE(0, BasicNormalizerTest);
132
 
        CASE_SUITE(1, NormalizerConformanceTest); // this takes a long time
133
 
        CASE_SUITE(2, CanonicalIteratorTest);
134
 
        default:
135
 
            name="";
136
 
            break;
137
 
    }
138
 
}