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