1ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru/******************************************************************** 2ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * COPYRIGHT: 3b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * Copyright (c) 1997-2008,2011, 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 CITERTST.H 9ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru* 10ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru* Modification History: 11ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru* Name Description 12ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru* Madhu Katragadda Converted to C 13ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru*********************************************************************************/ 14ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 15ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru/** 16ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * Collation Iterator tests. 17ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * (Let me reiterate my position...) 18ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru */ 19ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 20ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#ifndef _CITERCOLLTST 21ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#define _CITERCOLLTST 22ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 23ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#include "unicode/utypes.h" 24ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 25ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#if !UCONFIG_NO_COLLATION 26ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 27ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#include "unicode/ucol.h" 28ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#include "unicode/ucoleitr.h" 29ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#include "cintltst.h" 30ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 31ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#define MAX_TOKEN_LEN 16 32ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 3385bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho/** 3485bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho* Test for CollationElementIterator previous and next for the whole set of 3585bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho* unicode characters. 3685bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho*/ 3785bf2e2fbc60a9f938064abc8127d61da7d19882Claire Hostatic void TestUnicodeChar(void); 3885bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho/** 3985bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho* Test for CollationElementIterator previous and next for the whole set of 4085bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho* unicode characters with normalization on. 4185bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho*/ 4285bf2e2fbc60a9f938064abc8127d61da7d19882Claire Hostatic void TestNormalizedUnicodeChar(void); 4385bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho/** 4485bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho* Test incremental normalization 4585bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho*/ 4685bf2e2fbc60a9f938064abc8127d61da7d19882Claire Hostatic void TestNormalization(void); 4785bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho /** 4885bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho * Test for CollationElementIterator.previous() 4985bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho * 5085bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho * @bug 4108758 - Make sure it works with contracting characters 5185bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho * 5285bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho */ 5385bf2e2fbc60a9f938064abc8127d61da7d19882Claire Hostatic void TestPrevious(void); 5485bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho 5585bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho/** 5685bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho * Test for getOffset() and setOffset() 5785bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho */ 5885bf2e2fbc60a9f938064abc8127d61da7d19882Claire Hostatic void TestOffset(void); 5985bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho/** 6085bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho * Test for setText() 6185bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho */ 6285bf2e2fbc60a9f938064abc8127d61da7d19882Claire Hostatic void TestSetText(void); 6385bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho/** @bug 4108762 6485bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho * Test for getMaxExpansion() 6585bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho */ 6685bf2e2fbc60a9f938064abc8127d61da7d19882Claire Hostatic void TestMaxExpansion(void); 6785bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho/** 6885bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho* Test Bug 672, where different locales give a different offset after 6985bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho* a previous for the same string at the same position 7085bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho*/ 7185bf2e2fbc60a9f938064abc8127d61da7d19882Claire Hostatic void TestBug672(void); 72ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 7385bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho/** 7485bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho * Repeat TestBug672 with normalizatin enabled - this test revealed a bug 7585bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho * in incremental normalization. 7685bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho */ 7785bf2e2fbc60a9f938064abc8127d61da7d19882Claire Hostatic void TestBug672Normalize(void); 7885bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho/** 7985bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho* Test iterators with an relatively small buffer 8085bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho*/ 8185bf2e2fbc60a9f938064abc8127d61da7d19882Claire Hostatic void TestSmallBuffer(void); 8285bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho/** 8385bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho* Tests the CEs generated by the iterators. 8485bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho*/ 8585bf2e2fbc60a9f938064abc8127d61da7d19882Claire Hostatic void TestCEs(void); 8685bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho/** 8785bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho* Tests the discontiguos contractions 8885bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho*/ 8985bf2e2fbc60a9f938064abc8127d61da7d19882Claire Hostatic void TestDiscontiguos(void); 9085bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho/** 9185bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho* Tests that the iterators bails out when the CEBuffer is exhausted 9285bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho*/ 9385bf2e2fbc60a9f938064abc8127d61da7d19882Claire Hostatic void TestCEBufferOverflow(void); 9485bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho/** 9585bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho* Tests the validity of CEs generated by the iterators. 9685bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho* Bound checkings. 9785bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho*/ 9885bf2e2fbc60a9f938064abc8127d61da7d19882Claire Hostatic void TestCEValidity(void); 9985bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho/** 10085bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho* Tests the validity of sortkeys generated by the iterators. 10185bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho* Bound checkings. 10285bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho*/ 10385bf2e2fbc60a9f938064abc8127d61da7d19882Claire Hostatic void TestSortKeyValidity(void); 104b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho/** 105b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho* TestSearchCollatorElements tests iterator behavior (forwards and backwards) with 106b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho* normalization on AND jamo tailoring, among other things. 107b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho*/ 108b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2clairehostatic void TestSearchCollatorElements(void); 10985bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho 11085bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho/*------------------------------------------------------------------------ 11185bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho Internal utilities 11285bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho */ 113ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 114ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 11585bf2e2fbc60a9f938064abc8127d61da7d19882Claire Hostatic void assertEqual(UCollationElements *i1, UCollationElements *i2); 116ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 117ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 118ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#endif /* #if !UCONFIG_NO_COLLATION */ 119ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 120ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#endif 121