2000-01-15 02:00:06 +00:00
|
|
|
/********************************************************************
|
|
|
|
* COPYRIGHT:
|
2001-03-21 20:09:56 +00:00
|
|
|
* Copyright (c) 1997-2001, International Business Machines Corporation and
|
2000-01-15 02:00:06 +00:00
|
|
|
* others. All Rights Reserved.
|
|
|
|
********************************************************************/
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* CollationAPITest is a third level test class. This test performs API
|
|
|
|
* related tests for the Collation framework.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _APICOLL
|
|
|
|
#define _APICOLL
|
|
|
|
|
|
|
|
#ifndef _UTYPES
|
1999-12-28 23:57:50 +00:00
|
|
|
#include "unicode/utypes.h"
|
1999-08-16 21:50:52 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _COLL
|
1999-12-28 23:57:50 +00:00
|
|
|
#include "unicode/coll.h"
|
1999-08-16 21:50:52 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _TBLCOLL
|
1999-12-28 23:57:50 +00:00
|
|
|
#include "unicode/tblcoll.h"
|
1999-08-16 21:50:52 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _INTLTEST
|
|
|
|
#include "intltest.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
class CollationAPITest: public IntlTest {
|
|
|
|
public:
|
2000-08-23 19:11:16 +00:00
|
|
|
void runIndexedTest( int32_t index, UBool exec, const char* &name, char* /*par = NULL */);
|
2000-05-18 22:08:39 +00:00
|
|
|
void doAssert(UBool condition, const char *message);
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This tests the properties of a collator object.
|
|
|
|
* - constructor/destructor
|
|
|
|
* - factory method createInstance
|
|
|
|
* - compare and getCollationKey
|
|
|
|
* - get/set decomposition mode and comparison level
|
|
|
|
* - displayable name in the desired locale
|
|
|
|
*/
|
2000-08-23 19:11:16 +00:00
|
|
|
void TestProperty(/* char* par */);
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This tests the properties of a rule based collator object.
|
|
|
|
* - constructor/destructor
|
|
|
|
* - == and != operators
|
|
|
|
* - clone and copy
|
|
|
|
* - collation rules access
|
|
|
|
*/
|
2000-08-23 19:11:16 +00:00
|
|
|
void TestOperators(/* char* par */);
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This tests the duplication of a collator object.
|
|
|
|
*/
|
2000-08-23 19:11:16 +00:00
|
|
|
void TestDuplicate(/* char* par */);
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This tests the comparison convenience methods of a collator object.
|
|
|
|
* - greater than
|
|
|
|
* - greater than or equal to
|
|
|
|
* - equal to
|
|
|
|
*/
|
2000-08-23 19:11:16 +00:00
|
|
|
void TestCompare(/* char* par */);
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This tests the hashCode method of a collator object.
|
|
|
|
*/
|
2000-08-23 19:11:16 +00:00
|
|
|
void TestHashCode(/* char* par */);
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This tests the collation key related APIs.
|
|
|
|
* - constructor/destructor
|
|
|
|
* - Collator::getCollationKey
|
|
|
|
* - == and != operators
|
|
|
|
* - comparison between collation keys
|
|
|
|
* - creating collation key with a byte array and vice versa
|
|
|
|
*/
|
2000-08-23 19:11:16 +00:00
|
|
|
void TestCollationKey(/* char* par */);
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This tests the CollationElementIterator related APIs.
|
|
|
|
* - creation of a CollationElementIterator object
|
|
|
|
* - == and != operators
|
|
|
|
* - iterating forward
|
|
|
|
* - reseting the iterator index
|
|
|
|
* - requesting the order properties(primary, secondary or tertiary)
|
|
|
|
*/
|
2000-08-23 19:11:16 +00:00
|
|
|
void TestElemIter(/* char* par */);
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This tests the list the all available locales.
|
|
|
|
*/
|
2000-08-23 19:11:16 +00:00
|
|
|
void TestGetAll(/* char* par */);
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
// static constants
|
|
|
|
enum EToken_Len { MAX_TOKEN_LEN = 128 };
|
|
|
|
|
|
|
|
};
|
|
|
|
#endif
|