]>
Commit | Line | Data |
---|---|---|
1 | // © 2016 and later: Unicode, Inc. and others. | |
2 | // License & terms of use: http://www.unicode.org/copyright.html | |
3 | /******************************************************************** | |
4 | * COPYRIGHT: | |
5 | * Copyright (c) 1997-2008, International Business Machines Corporation and | |
6 | * others. All Rights Reserved. | |
7 | ********************************************************************/ | |
8 | /******************************************************************************** | |
9 | * | |
10 | * File CALLCOLL.H | |
11 | * | |
12 | * Modification History: | |
13 | * Name Description | |
14 | * Madhu Katragadda Ported to C | |
15 | ********************************************************************************* | |
16 | */ | |
17 | /** | |
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'. | |
21 | */ | |
22 | #ifndef _CALLCOLLTST | |
23 | #define _CALLCOLLTST | |
24 | ||
25 | #include "unicode/utypes.h" | |
26 | #include "unicode/ucoleitr.h" | |
27 | ||
28 | #if !UCONFIG_NO_COLLATION | |
29 | ||
30 | #include "cintltst.h" | |
31 | ||
32 | #define RULE_BUFFER_LEN 8192 | |
33 | ||
34 | struct OrderAndOffset | |
35 | { | |
36 | int32_t order; | |
37 | int32_t offset; | |
38 | }; | |
39 | ||
40 | typedef struct OrderAndOffset OrderAndOffset; | |
41 | ||
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); | |
48 | ||
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); | |
59 | ||
60 | ||
61 | #endif /* #if !UCONFIG_NO_COLLATION */ | |
62 | ||
63 | #endif |