ICU-1421 add test for copy constructor

X-SVN-Rev: 6797
This commit is contained in:
Alan Liu 2001-11-12 20:57:06 +00:00
parent a6c794e643
commit d1fc5965f4
2 changed files with 14 additions and 1 deletions

View file

@ -42,7 +42,8 @@ UnicodeSetTest::runIndexedTest(int32_t index, UBool exec,
CASE(5,TestAPI);
CASE(6,TestScriptSet);
CASE(7,TestPropertySet);
CASE(8,TestExhaustive);
CASE(8,TestClone);
CASE(9,TestExhaustive);
default: name = ""; break;
}
}
@ -441,6 +442,16 @@ void UnicodeSetTest::TestPropertySet() {
expectContainment(set, "abc", "ABC");
}
/**
* Test cloning of UnicodeSet. For C++, we test the copy constructor.
*/
void UnicodeSetTest::TestClone() {
UErrorCode ec = U_ZERO_ERROR;
UnicodeSet s("[abcxyz]", ec);
UnicodeSet t(s);
expectContainment(t, "abc", "def");
}
void UnicodeSetTest::TestExhaustive() {
// exhaustive tests. Simulate UnicodeSets with integers.
// That gives us very solid tests (except for large memory tests).

View file

@ -46,6 +46,8 @@ private:
*/
void TestPropertySet(void);
void TestClone(void);
void TestExhaustive(void);
private: