2000-01-15 02:00:06 +00:00
|
|
|
/********************************************************************
|
|
|
|
* COPYRIGHT:
|
2001-03-21 19:46:49 +00:00
|
|
|
* Copyright (c) 1997-2001, International Business Machines Corporation and
|
2000-01-15 02:00:06 +00:00
|
|
|
* others. All Rights Reserved.
|
|
|
|
********************************************************************/
|
|
|
|
/********************************************************************************
|
1999-08-16 21:50:52 +00:00
|
|
|
*
|
|
|
|
* File CITERTST.H
|
|
|
|
*
|
|
|
|
* Modification History:
|
|
|
|
* Name Description
|
|
|
|
* Madhu Katragadda Converted to C
|
2000-08-14 23:35:57 +00:00
|
|
|
*********************************************************************************/
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Collation Iterator tests.
|
|
|
|
* (Let me reiterate my position...)
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _CITERCOLLTST
|
|
|
|
#define _CITERCOLLTST
|
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
#include "unicode/utypes.h"
|
2002-09-20 17:54:45 +00:00
|
|
|
|
|
|
|
#if !UCONFIG_NO_COLLATION
|
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
#include "unicode/ucol.h"
|
2002-08-21 19:09:33 +00:00
|
|
|
#include "unicode/ucoleitr.h"
|
2002-09-20 17:54:45 +00:00
|
|
|
#include "cintltst.h"
|
2000-06-22 19:04:32 +00:00
|
|
|
|
2001-03-30 03:49:29 +00:00
|
|
|
#define MAX_TOKEN_LEN 16
|
|
|
|
|
2001-02-23 23:41:16 +00:00
|
|
|
/**
|
|
|
|
* Test for CollationElementIterator previous and next for the whole set of
|
|
|
|
* unicode characters.
|
|
|
|
*/
|
|
|
|
static void TestUnicodeChar(void);
|
2001-04-17 17:27:37 +00:00
|
|
|
/**
|
|
|
|
* Test for CollationElementIterator previous and next for the whole set of
|
|
|
|
* unicode characters with normalization on.
|
|
|
|
*/
|
|
|
|
static void TestNormalizedUnicodeChar(void);
|
2001-04-26 01:14:28 +00:00
|
|
|
/**
|
|
|
|
* Test incremental normalization
|
|
|
|
*/
|
|
|
|
static void TestNormalization(void);
|
|
|
|
/**
|
1999-08-16 21:50:52 +00:00
|
|
|
* Test for CollationElementIterator.previous()
|
|
|
|
*
|
|
|
|
* @bug 4108758 - Make sure it works with contracting characters
|
|
|
|
*
|
|
|
|
*/
|
2000-11-21 04:05:39 +00:00
|
|
|
static void TestPrevious(void);
|
2001-03-30 03:49:29 +00:00
|
|
|
|
1999-08-16 21:50:52 +00:00
|
|
|
/**
|
|
|
|
* Test for getOffset() and setOffset()
|
|
|
|
*/
|
2000-11-21 04:05:39 +00:00
|
|
|
static void TestOffset(void);
|
1999-08-16 21:50:52 +00:00
|
|
|
/**
|
|
|
|
* Test for setText()
|
|
|
|
*/
|
2000-11-21 04:05:39 +00:00
|
|
|
static void TestSetText(void);
|
2000-06-22 19:04:32 +00:00
|
|
|
/** @bug 4108762
|
|
|
|
* Test for getMaxExpansion()
|
|
|
|
*/
|
2000-11-21 04:05:39 +00:00
|
|
|
static void TestMaxExpansion(void);
|
2001-04-07 00:20:32 +00:00
|
|
|
/**
|
|
|
|
* Test Bug 672, where different locales give a different offset after
|
|
|
|
* a previous for the same string at the same position
|
|
|
|
*/
|
|
|
|
static void TestBug672(void);
|
2001-04-28 00:25:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Repeat TestBug672 with normalizatin enabled - this test revealed a bug
|
|
|
|
* in incremental normalization.
|
|
|
|
*/
|
|
|
|
static void TestBug672Normalize(void);
|
2001-04-17 17:27:37 +00:00
|
|
|
/**
|
|
|
|
* Test iterators with an relatively small buffer
|
|
|
|
*/
|
|
|
|
static void TestSmallBuffer(void);
|
2001-05-14 18:58:36 +00:00
|
|
|
/**
|
|
|
|
* Tests the CEs generated by the iterators.
|
|
|
|
*/
|
|
|
|
static void TestCEs(void);
|
|
|
|
/**
|
|
|
|
* Tests the discontiguos contractions
|
|
|
|
*/
|
|
|
|
static void TestDiscontiguos(void);
|
2001-05-17 21:35:14 +00:00
|
|
|
/**
|
|
|
|
* Tests that the iterators bails out when the CEBuffer is exhausted
|
|
|
|
*/
|
|
|
|
static void TestCEBufferOverflow(void);
|
2001-05-25 16:54:33 +00:00
|
|
|
/**
|
|
|
|
* Tests the validity of CEs generated by the iterators.
|
|
|
|
* Bound checkings.
|
|
|
|
*/
|
|
|
|
static void TestCEValidity(void);
|
|
|
|
/**
|
|
|
|
* Tests the validity of sortkeys generated by the iterators.
|
|
|
|
* Bound checkings.
|
|
|
|
*/
|
2001-05-30 17:38:28 +00:00
|
|
|
static void TestSortKeyValidity(void);
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
/*------------------------------------------------------------------------
|
|
|
|
Internal utilities
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
static void assertEqual(UCollationElements *i1, UCollationElements *i2);
|
|
|
|
|
|
|
|
|
|
|
|
static UChar *test1;
|
|
|
|
static UChar *test2;
|
|
|
|
|
2002-09-20 17:54:45 +00:00
|
|
|
#endif /* #if !UCONFIG_NO_COLLATION */
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
#endif
|