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