]>
git.saurik.com Git - apple/icu.git/blob - icuSources/test/intltest/itercoll.h
   1 /******************************************************************** 
   3  * Copyright (c) 1997-2001, International Business Machines Corporation and 
   4  * others. All Rights Reserved. 
   5  ********************************************************************/ 
   8  * Collation Iterator tests. 
   9  * (Let me reiterate my position...) 
  15 #include "unicode/utypes.h" 
  17 #if !UCONFIG_NO_COLLATION 
  19 #include "unicode/tblcoll.h" 
  20 #include "unicode/coleitr.h" 
  23 class CollationIteratorTest
: public IntlTestCollator
 
  27     // If this is too small for the test data, just increase it. 
  28     // Just don't make it too large, otherwise the executable will get too big 
  29     enum EToken_Len 
{ MAX_TOKEN_LEN 
= 16 }; 
  31     CollationIteratorTest(); 
  32     virtual ~CollationIteratorTest(); 
  34     void runIndexedTest(int32_t index
, UBool exec
, const char* &name
, char* par 
= NULL
); 
  37     * Test that results from CollationElementIterator.next is equivalent to 
  38     * the reversed results from CollationElementIterator.previous, for the set  
  41     void TestUnicodeChar(); 
  44      * Test for CollationElementIterator.previous() 
  46      * @bug 4108758 - Make sure it works with contracting characters 
  49     void TestPrevious(/* char* par */); 
  52      * Test for getOffset() and setOffset() 
  54     void TestOffset(/* char* par */); 
  59     void TestSetText(/* char* par */); 
  62      * Test for getMaxExpansion() 
  64     void TestMaxExpansion(/* char* par */); 
  69     void TestClearBuffers(/* char* par */); 
  72      * Testing the assignment operator 
  74     void TestAssignment(); 
  77      * Testing the constructors 
  79     void TestConstructors(); 
  82     * Testing the strength order functionality 
  84     void TestStrengthOrder(); 
  86     //------------------------------------------------------------------------ 
  92     struct ExpansionRecord
 
  99      * Verify that getMaxExpansion works on a given set of collation rules 
 101     void verifyExpansion(UnicodeString rules
, ExpansionRecord tests
[], int32_t testCount
); 
 104      * Return a string containing all of the collation orders 
 105      * returned by calls to next on the specified iterator 
 107     UnicodeString 
&orderString(CollationElementIterator 
&iter
, UnicodeString 
&target
); 
 109     void assertEqual(CollationElementIterator 
&i1
, CollationElementIterator 
&i2
); 
 111     RuleBasedCollator 
*en_us
; 
 112     const UnicodeString test1
; 
 113     const UnicodeString test2
; 
 117 #endif /* #if !UCONFIG_NO_COLLATION */