2000-01-15 02:00:06 +00:00
|
|
|
/********************************************************************
|
|
|
|
* COPYRIGHT:
|
2015-05-28 17:03:45 +00:00
|
|
|
* Copyright (c) 1997-2015, International Business Machines Corporation and
|
2000-01-15 02:00:06 +00:00
|
|
|
* others. All Rights Reserved.
|
|
|
|
********************************************************************/
|
1999-08-16 21:50:52 +00:00
|
|
|
|
2001-08-31 18:02:09 +00:00
|
|
|
#ifndef UNICODESTRINGTEST_H
|
|
|
|
#define UNICODESTRINGTEST_H
|
|
|
|
|
2005-05-20 17:31:12 +00:00
|
|
|
#include "unicode/unistr.h"
|
1999-08-16 21:50:52 +00:00
|
|
|
#include "intltest.h"
|
|
|
|
|
2011-02-03 05:28:01 +00:00
|
|
|
U_NAMESPACE_BEGIN
|
|
|
|
|
|
|
|
class Appendable;
|
|
|
|
|
|
|
|
U_NAMESPACE_END
|
|
|
|
|
1999-08-16 21:50:52 +00:00
|
|
|
/**
|
|
|
|
* Perform API and functionality tests for class UnicodeString
|
|
|
|
**/
|
|
|
|
class UnicodeStringTest: public IntlTest {
|
|
|
|
public:
|
2002-03-13 19:21:27 +00:00
|
|
|
UnicodeStringTest() {}
|
2003-10-24 01:04:44 +00:00
|
|
|
virtual ~UnicodeStringTest();
|
1999-08-16 21:50:52 +00:00
|
|
|
|
2000-08-14 21:42:36 +00:00
|
|
|
void runIndexedTest( int32_t index, UBool exec, const char* &name, char* par = NULL );
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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);
|
2011-07-07 18:21:28 +00:00
|
|
|
void TestStartsWithAndEndsWithNulTerminated();
|
1999-08-16 21:50:52 +00:00
|
|
|
/**
|
|
|
|
* 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);
|
2000-08-16 20:25:29 +00:00
|
|
|
/**
|
|
|
|
* Test the unescape() function.
|
|
|
|
*/
|
|
|
|
void TestUnescape(void);
|
2002-10-09 21:36:47 +00:00
|
|
|
|
|
|
|
void _testUnicodeStringHasMoreChar32Than(const UnicodeString &s, int32_t start, int32_t length, int32_t number);
|
2011-02-03 05:28:01 +00:00
|
|
|
void TestCountChar32();
|
2002-11-16 01:15:29 +00:00
|
|
|
void TestBogus();
|
2003-11-06 23:25:00 +00:00
|
|
|
void TestStringEnumeration();
|
2011-02-03 05:28:01 +00:00
|
|
|
void TestNameSpace();
|
|
|
|
void TestUTF32();
|
|
|
|
void TestUTF8();
|
|
|
|
void TestReadOnlyAlias();
|
|
|
|
void doTestAppendable(UnicodeString &dest, Appendable &app);
|
|
|
|
void TestAppendable();
|
|
|
|
void TestUnicodeStringImplementsAppendable();
|
2011-02-04 19:54:58 +00:00
|
|
|
void TestSizeofUnicodeString();
|
2015-05-28 17:03:45 +00:00
|
|
|
void TestMoveSwap();
|
1999-08-16 21:50:52 +00:00
|
|
|
};
|
|
|
|
|
2002-03-13 19:21:27 +00:00
|
|
|
class StringCaseTest: public IntlTest {
|
|
|
|
public:
|
|
|
|
StringCaseTest() {}
|
2003-10-24 01:04:44 +00:00
|
|
|
virtual ~StringCaseTest();
|
2012-01-20 19:35:13 +00:00
|
|
|
|
2002-03-13 19:21:27 +00:00
|
|
|
void runIndexedTest(int32_t index, UBool exec, const char *&name, char *par=0);
|
|
|
|
|
|
|
|
void TestCaseConversion();
|
2005-05-20 17:31:12 +00:00
|
|
|
|
|
|
|
void TestCasingImpl(const UnicodeString &input,
|
|
|
|
const UnicodeString &output,
|
|
|
|
int32_t whichCase,
|
2007-07-27 06:37:08 +00:00
|
|
|
void *iter, const char *localeID, uint32_t options);
|
2005-05-20 17:31:12 +00:00
|
|
|
void TestCasing();
|
2012-01-20 19:35:13 +00:00
|
|
|
void TestFullCaseFoldingIterator();
|
2002-03-13 19:21:27 +00:00
|
|
|
};
|
|
|
|
|
2001-08-31 18:02:09 +00:00
|
|
|
#endif
|