]>
git.saurik.com Git - apple/icu.git/blob - icuSources/test/intltest/mnkytst.h
1 /********************************************************************
3 * Copyright (c) 1997-2003, International Business Machines Corporation and
4 * others. All Rights Reserved.
5 ********************************************************************/
8 * CollationMonkeyTest is a third level test class. This tests the random
9 * substrings of the default test strings to verify if the compare and
10 * sort key algorithm works correctly. For example, any string is always
11 * less than the string itself appended with any character.
17 #include "unicode/utypes.h"
19 #if !UCONFIG_NO_COLLATION
23 class CollationMonkeyTest
: public IntlTestCollator
{
25 // If this is too small for the test data, just increase it.
26 // Just don't make it too large, otherwise the executable will get too big
27 enum EToken_Len
{ MAX_TOKEN_LEN
= 16 };
29 CollationMonkeyTest();
30 virtual ~CollationMonkeyTest();
31 void runIndexedTest( int32_t index
, UBool exec
, const char* &name
, char* par
= NULL
);
33 // utility function used in tests, returns absolute value
34 int32_t checkValue(int32_t value
);
36 // perform monkey tests using Collator::compare
37 void TestCompare(/* char* par */);
39 // perform monkey tests using CollationKey::compareTo
40 void TestCollationKey(/* char* par */);
42 void TestRules(/* char* par */);
45 void report(UnicodeString
& s
, UnicodeString
& t
, int32_t result
, int32_t revResult
);
47 const UnicodeString source
;
52 #endif /* #if !UCONFIG_NO_COLLATION */