mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-20 20:19:32 +00:00
ICU-176 test constructors from UChar32 and from capacity
X-SVN-Rev: 1173
This commit is contained in:
parent
a84cd3f751
commit
47ba9784e0
1 changed files with 30 additions and 0 deletions
|
@ -640,4 +640,34 @@ UnicodeStringTest::TestStackAllocation()
|
|||
}
|
||||
|
||||
delete test;
|
||||
|
||||
// test the UChar32 constructor
|
||||
UnicodeString c32Test((UChar32)0x10ff2a);
|
||||
if( c32Test.length() != Unicode::charLength(0x10ff2a) ||
|
||||
c32Test.char32At(c32Test.length() - 1) != 0x10ff2a
|
||||
) {
|
||||
errln("The UnicodeString(UChar32) constructor does not work with a 0x10ff2a filler");
|
||||
}
|
||||
|
||||
// test the (new) capacity constructor
|
||||
UnicodeString capTest(5, 0x2a, 5);
|
||||
if( capTest.length() != 5 * Unicode::charLength(0x2a) ||
|
||||
capTest.char32At(0) != 0x2a ||
|
||||
capTest.char32At(4) != 0x2a
|
||||
) {
|
||||
errln("The UnicodeString capacity constructor does not work with an ASCII filler");
|
||||
}
|
||||
|
||||
capTest = UnicodeString(5, 0x10ff2a, 5);
|
||||
if( capTest.length() != 5 * Unicode::charLength(0x10ff2a) ||
|
||||
capTest.char32At(0) != 0x10ff2a ||
|
||||
capTest.char32At(4) != 0x10ff2a
|
||||
) {
|
||||
errln("The UnicodeString capacity constructor does not work with a 0x10ff2a filler");
|
||||
}
|
||||
|
||||
capTest = UnicodeString(5, (UChar32)0, 0);
|
||||
if(capTest.length() != 0) {
|
||||
errln("The UnicodeString capacity constructor does not work with a 0x10ff2a filler");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue