1999-12-16 01:41:19 +00:00
|
|
|
/*
|
|
|
|
**********************************************************************
|
|
|
|
* Copyright (C) 1999, International Business Machines
|
|
|
|
* Corporation and others. All Rights Reserved.
|
|
|
|
**********************************************************************
|
|
|
|
* Date Name Description
|
|
|
|
* 12/09/99 aliu Ported from Java.
|
|
|
|
**********************************************************************
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "intltest.h"
|
|
|
|
|
|
|
|
class Collator;
|
|
|
|
class UnicodeString;
|
|
|
|
|
|
|
|
class CollationThaiTest : public IntlTest {
|
|
|
|
Collator* coll; // Thai collator
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
CollationThaiTest();
|
2000-04-18 17:58:18 +00:00
|
|
|
virtual ~CollationThaiTest();
|
1999-12-16 01:41:19 +00:00
|
|
|
|
2000-05-18 22:08:39 +00:00
|
|
|
void runIndexedTest( int32_t index, UBool exec, char* &name, char* par = NULL );
|
1999-12-16 01:41:19 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Read the external dictionary file, which is already in proper
|
|
|
|
* sorted order, and confirm that the collator compares each line as
|
|
|
|
* preceding the following line.
|
|
|
|
*/
|
1999-12-22 22:57:04 +00:00
|
|
|
void TestDictionary(void);
|
1999-12-16 01:41:19 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Odd corner conditions taken from "How to Sort Thai Without Rewriting Sort",
|
|
|
|
* by Doug Cooper, http://seasrc.th.net/paper/thaisort.zip
|
|
|
|
*/
|
1999-12-22 22:57:04 +00:00
|
|
|
void TestCornerCases(void);
|
1999-12-16 01:41:19 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
void compareArray(const Collator& c, const char* tests[],
|
|
|
|
int32_t testsLength);
|
|
|
|
|
|
|
|
int8_t sign(int32_t i);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set a UnicodeString corresponding to the given string. Use
|
|
|
|
* UnicodeString and the default converter, unless we see the sequence
|
|
|
|
* "\\u", in which case we interpret the subsequent escape.
|
|
|
|
*/
|
|
|
|
UnicodeString& parseChars(UnicodeString& result,
|
|
|
|
const char* chars);
|
|
|
|
};
|