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