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