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

« back to all changes in this revision

Viewing changes to source/test/intltest/g7coll.h

  • 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) 1997-2001, International Business Machines Corporation and
4
 
 * others. All Rights Reserved.
5
 
 ********************************************************************/
6
 
 
7
 
/**
8
 
 * G7CollationTest is a third level test class.  This test performs the examples 
9
 
 * mentioned on the Taligent international demos web site.  
10
 
 * Sample Rules: & Z < p , P 
11
 
 * Effect :  Making P sort after Z.
12
 
 *
13
 
 * Sample Rules: & c < ch , cH, Ch, CH 
14
 
 * Effect : As well as adding sequences of characters that act as a single character (this is
15
 
 * known as contraction), you can also add characters that act like a sequence of
16
 
 * characters (this is known as expansion).  
17
 
 * 
18
 
 * Sample Rules: & Question'-'mark ; '?' & Hash'-'mark ; '#' & Ampersand ; '&' 
19
 
 * Effect : Expansion and contraction can actually be combined.  
20
 
 * 
21
 
 * Sample Rules: & aa ; a'-' & ee ; e'-' & ii ; i'-' & oo ; o'-' & uu ; u'-'
22
 
 * Effect : sorted sequence as the following,
23
 
 * aardvark  
24
 
 * a-rdvark  
25
 
 * abbot  
26
 
 * coop  
27
 
 * co-p  
28
 
 * cop 
29
 
 */
30
 
 
31
 
#ifndef _G7COLL
32
 
#define _G7COLL
33
 
 
34
 
#include "unicode/tblcoll.h"
35
 
#include "tscoll.h"
36
 
 
37
 
class G7CollationTest: public IntlTestCollator {
38
 
public:
39
 
    // If this is too small for the test data, just increase it.
40
 
    // Just don't make it too large, otherwise the executable will get too big
41
 
    enum EToken_Len { MAX_TOKEN_LEN = 16 };
42
 
 
43
 
    enum ETotal_Locales { TESTLOCALES = 12 };
44
 
    enum ETotal_Fixed { FIXEDTESTSET = 15 };
45
 
    enum ETotal_Test { TOTALTESTSET = 30 };
46
 
 
47
 
    G7CollationTest() {}
48
 
    virtual ~G7CollationTest() {}
49
 
    void runIndexedTest( int32_t index, UBool exec, const char* &name, char* par = NULL );
50
 
 
51
 
    // main test routine, tests comparisons for a set of strings against sets of expected results
52
 
    void doTest( Collator* col, UnicodeString source, UnicodeString target, Collator::EComparisonResult result);
53
 
 
54
 
    // perform test for G7 locales
55
 
    void TestG7Locales(/* char* par */);
56
 
 
57
 
    // perform test with added rules " & Z < p, P"
58
 
    void TestDemo1(/* char* par */);
59
 
 
60
 
    // perorm test with added rules "& C < ch , cH, Ch, CH"
61
 
    void TestDemo2(/* char* par */);
62
 
 
63
 
    // perform test with added rules 
64
 
    // "& Question'-'mark ; '?' & Hash'-'mark ; '#' & Ampersand ; '&'"
65
 
    void TestDemo3(/* char* par */);
66
 
 
67
 
    // perform test with added rules 
68
 
    // " & aa ; a'-' & ee ; e'-' & ii ; i'-' & oo ; o'-' & uu ; u'-' "
69
 
    void TestDemo4(/* char* par */);
70
 
 
71
 
private:
72
 
    static const UChar testCases[][MAX_TOKEN_LEN];
73
 
    static const int32_t results[TESTLOCALES][TOTALTESTSET];
74
 
};
75
 
#endif