]> git.saurik.com Git - apple/icu.git/blame - icuSources/test/intltest/dadrcoll.h
ICU-400.42.tar.gz
[apple/icu.git] / icuSources / test / intltest / dadrcoll.h
CommitLineData
b75a7d8f
A
1/********************************************************************
2 * COPYRIGHT:
73c04bcf 3 * Copyright (c) 2002-2005, International Business Machines Corporation and
b75a7d8f
A
4 * others. All Rights Reserved.
5 ********************************************************************/
6
7/**
8 * DataDrivenCollatorTest is a test class that uses data stored in resource
9 * bundles to perform testing. For more details on data structure, see
10 * source/test/testdata/DataDrivenCollationTest.txt
11 */
12
13#ifndef _INTLTESTDATADRIVENCOLLATOR
14#define _INTLTESTDATADRIVENCOLLATOR
15
16#include "unicode/utypes.h"
17
18#if !UCONFIG_NO_COLLATION
19
20#include "tscoll.h"
21#include "uvector.h"
22#include "unicode/coll.h"
23#include "unicode/tblcoll.h"
24#include "unicode/sortkey.h"
25#include "unicode/schriter.h"
374ca955
A
26
27class TestDataModule;
28class TestData;
b75a7d8f
A
29
30class SeqElement {
31public:
32 UnicodeString source;
33 Collator::EComparisonResult relation;
34};
35
36class DataDrivenCollatorTest: public IntlTestCollator {
37 void runIndexedTest(int32_t index, UBool exec, const char* &name, char* par = NULL );
38public:
39 DataDrivenCollatorTest();
40 virtual ~DataDrivenCollatorTest();
41protected:
42
43 void DataDrivenTest(char *par);
44 void processSequence(Collator* col, const UnicodeString &sequence);
45 void processTest(TestData *testData);
46 void processArguments(Collator *col, const UChar *start, int32_t optLen);
47 UBool setTestSequence(const UnicodeString &setSequence, SeqElement &el);
48 UBool getNextInSequence(SeqElement &el);
49private:
50 StringCharacterIterator seq;
51 TestDataModule *driver;
52 UErrorCode status;
53 UVector sequences;
73c04bcf 54 RuleBasedCollator *UCA; // needed for opening collators from binary images
b75a7d8f
A
55};
56
57#endif /* #if !UCONFIG_NO_COLLATION */
58
59#endif