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