Home | History | Annotate | Download | only in cintltst
      1 /********************************************************************
      2  * COPYRIGHT:
      3  * Copyright (c) 1997-2008, International Business Machines Corporation and
      4  * others. All Rights Reserved.
      5  ********************************************************************/
      6 /********************************************************************************
      7 *
      8 * File CITERTST.H
      9 *
     10 * Modification History:
     11 *        Name                     Description
     12 *     Madhu Katragadda            Converted to C
     13 *********************************************************************************/
     14 
     15 /**
     16  * Collation Iterator tests.
     17  * (Let me reiterate my position...)
     18  */
     19 
     20 #ifndef _CITERCOLLTST
     21 #define _CITERCOLLTST
     22 
     23 #include "unicode/utypes.h"
     24 
     25 #if !UCONFIG_NO_COLLATION
     26 
     27 #include "unicode/ucol.h"
     28 #include "unicode/ucoleitr.h"
     29 #include "cintltst.h"
     30 
     31 #define MAX_TOKEN_LEN 16
     32 
     33 /**
     34 * Test for CollationElementIterator previous and next for the whole set of
     35 * unicode characters.
     36 */
     37 static void TestUnicodeChar(void);
     38 /**
     39 * Test for CollationElementIterator previous and next for the whole set of
     40 * unicode characters with normalization on.
     41 */
     42 static void TestNormalizedUnicodeChar(void);
     43 /**
     44 * Test incremental normalization
     45 */
     46 static void TestNormalization(void);
     47  /**
     48  * Test for CollationElementIterator.previous()
     49  *
     50  * @bug 4108758 - Make sure it works with contracting characters
     51  *
     52  */
     53 static void TestPrevious(void);
     54 
     55 /**
     56  * Test for getOffset() and setOffset()
     57  */
     58 static void TestOffset(void);
     59 /**
     60  * Test for setText()
     61  */
     62 static void TestSetText(void);
     63 /** @bug 4108762
     64  * Test for getMaxExpansion()
     65  */
     66 static void TestMaxExpansion(void);
     67 /**
     68 * Test Bug 672, where different locales give a different offset after
     69 * a previous for the same string at the same position
     70 */
     71 static void TestBug672(void);
     72 
     73 /**
     74  * Repeat TestBug672 with normalizatin enabled - this test revealed a bug
     75  *   in incremental normalization.
     76  */
     77 static void TestBug672Normalize(void);
     78 /**
     79 * Test iterators with an relatively small buffer
     80 */
     81 static void TestSmallBuffer(void);
     82 /**
     83 * Tests the CEs generated by the iterators.
     84 */
     85 static void TestCEs(void);
     86 /**
     87 * Tests the discontiguos contractions
     88 */
     89 static void TestDiscontiguos(void);
     90 /**
     91 * Tests that the iterators bails out when the CEBuffer is exhausted
     92 */
     93 static void TestCEBufferOverflow(void);
     94 /**
     95 * Tests the validity of CEs generated by the iterators.
     96 * Bound checkings.
     97 */
     98 static void TestCEValidity(void);
     99 /**
    100 * Tests the validity of sortkeys generated by the iterators.
    101 * Bound checkings.
    102 */
    103 static void TestSortKeyValidity(void);
    104 
    105 /*------------------------------------------------------------------------
    106  Internal utilities
    107  */
    108 
    109 
    110 static void assertEqual(UCollationElements *i1, UCollationElements *i2);
    111 
    112 
    113 #endif /* #if !UCONFIG_NO_COLLATION */
    114 
    115 #endif
    116