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
|
|
|
|
|
2002-09-21 00:43:14 +00:00
|
|
|
#include "unicode/utypes.h"
|
|
|
|
|
|
|
|
#if !UCONFIG_NO_COLLATION
|
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
#include "unicode/tblcoll.h"
|
2001-08-31 18:02:09 +00:00
|
|
|
#include "tscoll.h"
|
1999-08-16 21:50:52 +00:00
|
|
|
|
2001-08-31 18:02:09 +00:00
|
|
|
class CollationAPITest: public IntlTestCollator {
|
1999-08-16 21:50:52 +00:00
|
|
|
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
|
|
|
|
2001-03-23 00:57:44 +00:00
|
|
|
/**
|
|
|
|
* This tests the RuleBasedCollator
|
|
|
|
* - constructor/destructor
|
|
|
|
* - getRules
|
|
|
|
*/
|
|
|
|
void TestRuleBasedColl(/* char* par */);
|
|
|
|
|
2002-02-13 02:57:21 +00:00
|
|
|
/**
|
|
|
|
* This tests the RuleBasedCollator
|
|
|
|
* - getRules
|
|
|
|
*/
|
|
|
|
void TestRules(/* char* par */);
|
|
|
|
|
2001-03-23 00:57:44 +00:00
|
|
|
/**
|
|
|
|
* Tests decomposition setting
|
|
|
|
*/
|
|
|
|
void TestDecomposition();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* SafeClone test
|
|
|
|
*/
|
|
|
|
void TestSafeClone();
|
|
|
|
|
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
|
|
|
|
2001-06-26 17:44:23 +00:00
|
|
|
/**
|
|
|
|
* This tests the sort keys generated by collator
|
|
|
|
*/
|
|
|
|
void TestSortKey();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This tests getMaxExpansion
|
|
|
|
*/
|
|
|
|
void TestMaxExpansion();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Tests the retrieval of names given a locale
|
|
|
|
*/
|
|
|
|
void TestDisplayName();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Tests the collator attributes
|
|
|
|
*/
|
|
|
|
void TestAttribute();
|
|
|
|
|
2001-06-26 22:25:23 +00:00
|
|
|
/**
|
|
|
|
* Tests the setters and getters of variable top
|
|
|
|
*/
|
|
|
|
void TestVariableTopSetting();
|
|
|
|
|
2002-02-28 21:51:25 +00:00
|
|
|
/**
|
|
|
|
* Tests GetLocale for a Collator
|
|
|
|
*/
|
|
|
|
void TestGetLocale();
|
2002-08-10 00:12:23 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Tests bounds API
|
|
|
|
*/
|
|
|
|
void TestBounds();
|
|
|
|
|
2002-09-17 06:27:51 +00:00
|
|
|
/**
|
|
|
|
* Tests getTailoredSet API
|
|
|
|
*/
|
|
|
|
void TestGetTailoredSet();
|
|
|
|
|
1999-08-16 21:50:52 +00:00
|
|
|
private:
|
2001-03-30 01:22:03 +00:00
|
|
|
// If this is too small for the test data, just increase it.
|
|
|
|
// Just don't make it too large, otherwise the executable will get too big
|
|
|
|
enum EToken_Len { MAX_TOKEN_LEN = 16 };
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
};
|
2002-09-21 00:43:14 +00:00
|
|
|
|
|
|
|
#endif /* #if !UCONFIG_NO_COLLATION */
|
|
|
|
|
1999-08-16 21:50:52 +00:00
|
|
|
#endif
|