1 // Copyright (C) 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 /********************************************************************
5 * Copyright (c) 1997-2008, International Business Machines Corporation and
6 * others. All Rights Reserved.
7 ********************************************************************/
8 /********************************************************************************
12 * Modification History:
14 * Madhu Katragadda Ported to C
15 *********************************************************************************
18 * CollationDummyTest is a third level test class. This tests creation of
19 * a customized collator object. For example, number 1 to be sorted
20 * equlivalent to word 'one'.
25 #include "unicode/utypes.h"
26 #include "unicode/ucoleitr.h"
28 #if !UCONFIG_NO_COLLATION
32 #define RULE_BUFFER_LEN 8192
40 typedef struct OrderAndOffset OrderAndOffset;
42 /* tests comparison of custom collation with different strengths */
43 void doTest(UCollator*, const UChar* source, const UChar* target, UCollationResult result);
44 /* verify that iterating forward and backwards over the string yields same CEs */
45 void backAndForth(UCollationElements *iter);
46 /* gets an array of CEs for a string in UCollationElements iterator. */
47 OrderAndOffset* getOrders(UCollationElements *iter, int32_t *orderLength);
49 void genericOrderingTestWithResult(UCollator *coll, const char * const s[], uint32_t size, UCollationResult result);
50 void genericOrderingTest(UCollator *coll, const char * const s[], uint32_t size);
51 void genericLocaleStarter(const char *locale, const char * const s[], uint32_t size);
52 void genericLocaleStarterWithResult(const char *locale, const char * const s[], uint32_t size, UCollationResult result);
53 void genericLocaleStarterWithOptions(const char *locale, const char * const s[], uint32_t size, const UColAttribute *attrs, const UColAttributeValue *values, uint32_t attsize);
54 void genericLocaleStarterWithOptionsAndResult(const char *locale, const char * const s[], uint32_t size, const UColAttribute *attrs, const UColAttributeValue *values, uint32_t attsize, UCollationResult result);
55 void genericRulesStarterWithResult(const char *rules, const char * const s[], uint32_t size, UCollationResult result);
56 void genericRulesStarter(const char *rules, const char * const s[], uint32_t size);
57 void genericRulesStarterWithOptionsAndResult(const char *rules, const char * const s[], uint32_t size, const UColAttribute *attrs, const UColAttributeValue *values, uint32_t attsize, UCollationResult result);
58 UBool hasCollationElements(const char *locName);
61 #endif /* #if !UCONFIG_NO_COLLATION */