164339d36f8bd4db5025fe2988eda22b491a9219cFredrik Roubert// Copyright (C) 2016 and later: Unicode, Inc. and others.
264339d36f8bd4db5025fe2988eda22b491a9219cFredrik Roubert// License & terms of use: http://www.unicode.org/copyright.html
3ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru/********************************************************************
4ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * COPYRIGHT:
585bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho * Copyright (c) 1997-2008, International Business Machines Corporation and
6ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * others. All Rights Reserved.
7ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru ********************************************************************/
8ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru/********************************************************************************
9ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru*
10ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru* File CALLCOLL.H
11ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru*
12ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru* Modification History:
13ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru*        Name                     Description
14ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru*     Madhu Katragadda              Ported to C
15ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru*********************************************************************************
16ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru*/
17ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru/**
18ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * CollationDummyTest is a third level test class.  This tests creation of
19ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * a customized collator object.  For example, number 1 to be sorted
20ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * equlivalent to word 'one'.
21ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru */
22ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#ifndef _CALLCOLLTST
23ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#define _CALLCOLLTST
24ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
25ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#include "unicode/utypes.h"
26ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#include "unicode/ucoleitr.h"
27ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
28ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#if !UCONFIG_NO_COLLATION
29ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
30ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#include "cintltst.h"
31ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
32ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#define RULE_BUFFER_LEN 8192
33ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
3485bf2e2fbc60a9f938064abc8127d61da7d19882Claire Hostruct OrderAndOffset
3585bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho{
3685bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho    int32_t order;
3785bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho    int32_t offset;
3885bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho};
3985bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho
4085bf2e2fbc60a9f938064abc8127d61da7d19882Claire Hotypedef struct OrderAndOffset OrderAndOffset;
41ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
42ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    /* tests comparison of custom collation with different strengths */
43ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruvoid doTest(UCollator*, const UChar* source, const UChar* target, UCollationResult result);
44ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru/* verify that iterating forward and backwards over the string yields same CEs */
45ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruvoid backAndForth(UCollationElements *iter);
46ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru/* gets an array of CEs for a string in UCollationElements iterator. */
4785bf2e2fbc60a9f938064abc8127d61da7d19882Claire HoOrderAndOffset* getOrders(UCollationElements *iter, int32_t *orderLength);
48ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
49ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruvoid genericOrderingTestWithResult(UCollator *coll, const char * const s[], uint32_t size, UCollationResult result);
50ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruvoid genericOrderingTest(UCollator *coll, const char * const s[], uint32_t size);
51ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruvoid genericLocaleStarter(const char *locale, const char * const s[], uint32_t size);
52ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruvoid genericLocaleStarterWithResult(const char *locale, const char * const s[], uint32_t size, UCollationResult result);
53ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruvoid genericLocaleStarterWithOptions(const char *locale, const char * const s[], uint32_t size, const UColAttribute *attrs, const UColAttributeValue *values, uint32_t attsize);
54ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruvoid genericLocaleStarterWithOptionsAndResult(const char *locale, const char * const s[], uint32_t size, const UColAttribute *attrs, const UColAttributeValue *values, uint32_t attsize, UCollationResult result);
55ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruvoid genericRulesStarterWithResult(const char *rules, const char * const s[], uint32_t size, UCollationResult result);
56ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruvoid genericRulesStarter(const char *rules, const char * const s[], uint32_t size);
57ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruvoid genericRulesStarterWithOptionsAndResult(const char *rules, const char * const s[], uint32_t size, const UColAttribute *attrs, const UColAttributeValue *values, uint32_t attsize, UCollationResult result);
58ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruUBool hasCollationElements(const char *locName);
59ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
60ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
61ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#endif /* #if !UCONFIG_NO_COLLATION */
62ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
63ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#endif
64