Home | History | Annotate | Download | only in cintltst
      1 /********************************************************************
      2  * COPYRIGHT:
      3  * Copyright (c) 1997-2014, 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 discontiguos contractions
     84 */
     85 static void TestDiscontiguos(void);
     86 /**
     87 * TestSearchCollatorElements tests iterator behavior (forwards and backwards) with
     88 * normalization on AND jamo tailoring, among other things.
     89 */
     90 static void TestSearchCollatorElements(void);
     91 
     92 /*------------------------------------------------------------------------
     93  Internal utilities
     94  */
     95 
     96 
     97 static void assertEqual(UCollationElements *i1, UCollationElements *i2);
     98 
     99 
    100 #endif /* #if !UCONFIG_NO_COLLATION */
    101 
    102 #endif
    103