Home | History | Annotate | Download | only in intltest
      1 /********************************************************************
      2  * COPYRIGHT:
      3  * Copyright (c) 1997-2010, International Business Machines Corporation and
      4  * others. All Rights Reserved.
      5  ********************************************************************/
      6 
      7 #ifndef UNICODESTRINGTEST_H
      8 #define UNICODESTRINGTEST_H
      9 
     10 #include "unicode/unistr.h"
     11 #include "intltest.h"
     12 
     13 /**
     14  * Perform API and functionality tests for class UnicodeString
     15  **/
     16 class UnicodeStringTest: public IntlTest {
     17 public:
     18     UnicodeStringTest() {}
     19     virtual ~UnicodeStringTest();
     20 
     21     void runIndexedTest( int32_t index, UBool exec, const char* &name, char* par = NULL );
     22 
     23     /**
     24      * Test some basic methods (insert, remove, replace, ...)
     25      **/
     26     void TestBasicManipulation(void);
     27     /**
     28      * Test the methods for comparison
     29      **/
     30     void TestCompare(void);
     31     /**
     32      * Test the methods for extracting
     33      **/
     34     void TestExtract(void);
     35     /**
     36      * More extensively test methods for removing and replacing
     37      **/
     38     void TestRemoveReplace(void);
     39     /**
     40      * Test language specific case conversions
     41      **/
     42     void TestSearching(void);
     43     /**
     44      * Test methods for padding, trimmimg and truncating
     45      **/
     46     void TestSpacePadding(void);
     47     /**
     48      * Test methods startsWith and endsWith
     49      **/
     50     void TestPrefixAndSuffix(void);
     51     /**
     52      * Test method findAndReplace
     53      **/
     54     void TestFindAndReplace(void);
     55     /**
     56      * Test method reverse
     57      **/
     58     void TestReverse(void);
     59     /**
     60      * Test a few miscellaneous methods (isBogus, hashCode,...)
     61      **/
     62     void TestMiscellaneous(void);
     63     /**
     64      * Test the functionality of allocating UnicodeStrings on the stack
     65      **/
     66     void TestStackAllocation(void);
     67     /**
     68      * Test the unescape() function.
     69      */
     70     void TestUnescape(void);
     71 
     72     void _testUnicodeStringHasMoreChar32Than(const UnicodeString &s, int32_t start, int32_t length, int32_t number);
     73     void TestCountChar32(void);
     74     void TestBogus();
     75     void TestStringEnumeration();
     76     void TestCharString(void);
     77     void TestNameSpace(void);
     78     void TestUTF32(void);
     79     void TestUTF8(void);
     80     void TestReadOnlyAlias(void);
     81 };
     82 
     83 class StringCaseTest: public IntlTest {
     84 public:
     85     StringCaseTest() {}
     86     virtual ~StringCaseTest();
     87 
     88     void runIndexedTest(int32_t index, UBool exec, const char *&name, char *par=0);
     89 
     90     void TestCaseConversion();
     91 
     92     void TestCasingImpl(const UnicodeString &input,
     93                         const UnicodeString &output,
     94                         int32_t whichCase,
     95                         void *iter, const char *localeID, uint32_t options);
     96     void TestCasing();
     97 };
     98 
     99 #endif
    100