]>
Commit | Line | Data |
---|---|---|
1 | /******************************************************************** | |
2 | * COPYRIGHT: | |
3 | * Copyright (c) 1997-2007, 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 | }; | |
79 | ||
80 | class StringCaseTest: public IntlTest { | |
81 | public: | |
82 | StringCaseTest() {} | |
83 | virtual ~StringCaseTest(); | |
84 | ||
85 | void runIndexedTest(int32_t index, UBool exec, const char *&name, char *par=0); | |
86 | ||
87 | void TestCaseConversion(); | |
88 | ||
89 | void TestCasingImpl(const UnicodeString &input, | |
90 | const UnicodeString &output, | |
91 | int32_t whichCase, | |
92 | void *iter, const char *localeID, uint32_t options); | |
93 | void TestCasing(); | |
94 | }; | |
95 | ||
96 | #endif |