1/******************************************************************** 2 * COPYRIGHT: 3 * Copyright (c) 1997-2015, 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 13U_NAMESPACE_BEGIN 14 15class Appendable; 16 17U_NAMESPACE_END 18 19/** 20 * Perform API and functionality tests for class UnicodeString 21 **/ 22class UnicodeStringTest: public IntlTest { 23public: 24 UnicodeStringTest() {} 25 virtual ~UnicodeStringTest(); 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); 57 void TestStartsWithAndEndsWithNulTerminated(); 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); 80 void TestCountChar32(); 81 void TestBogus(); 82 void TestStringEnumeration(); 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(); 91 void TestMoveSwap(); 92}; 93 94class StringCaseTest: public IntlTest { 95public: 96 StringCaseTest() {} 97 virtual ~StringCaseTest(); 98 99 void runIndexedTest(int32_t index, UBool exec, const char *&name, char *par=0); 100 101 void TestCaseConversion(); 102 103 void TestCasingImpl(const UnicodeString &input, 104 const UnicodeString &output, 105 int32_t whichCase, 106 void *iter, const char *localeID, uint32_t options); 107 void TestCasing(); 108 void TestFullCaseFoldingIterator(); 109}; 110 111#endif 112