]> git.saurik.com Git - apple/icu.git/blame - icuSources/test/intltest/thcoll.h
ICU-3.13.tar.gz
[apple/icu.git] / icuSources / test / intltest / thcoll.h
CommitLineData
b75a7d8f
A
1/*
2**********************************************************************
3* Copyright (C) 1999-2003, International Business Machines
4* Corporation and others. All Rights Reserved.
5**********************************************************************
6* Date Name Description
7* 12/09/99 aliu Ported from Java.
8**********************************************************************
9*/
10
11#ifndef COLLATIONTHAITEST_H
12#define COLLATIONTHAITEST_H
13
14#include "unicode/utypes.h"
15
16#if !UCONFIG_NO_COLLATION
17
18#include "tscoll.h"
19
20class CollationThaiTest : public IntlTestCollator {
21 Collator* coll; // Thai collator
22
23public:
24
25 CollationThaiTest();
26 virtual ~CollationThaiTest();
27
28 void runIndexedTest( int32_t index, UBool exec, const char* &name, char* par = NULL );
29
30private:
31
32 /**
33 * Read the external dictionary file, which is already in proper
34 * sorted order, and confirm that the collator compares each line as
35 * preceding the following line.
36 */
37 void TestDictionary(void);
38
39 /**
40 * Odd corner conditions taken from "How to Sort Thai Without Rewriting Sort",
41 * by Doug Cooper, http://seasrc.th.net/paper/thaisort.zip
42 */
43 void TestCornerCases(void);
44
45 /**
46 * Read the external names list, and confirms that the collator
47 * gets the same results when comparing lines one to another
48 * using regular and iterative comparison.
49 */
50 void TestNamesList(void);
51
52private:
53
54 void compareArray(const Collator& c, const char* tests[],
55 int32_t testsLength);
56
57 int8_t sign(int32_t i);
58
59 /**
60 * Set a UnicodeString corresponding to the given string. Use
61 * UnicodeString and the default converter, unless we see the sequence
62 * "\\u", in which case we interpret the subsequent escape.
63 */
64 UnicodeString& parseChars(UnicodeString& result,
65 const char* chars);
66};
67
68#endif /* #if !UCONFIG_NO_COLLATION */
69
70#endif