ICU-827 test extract(char *, invariant) preflighting
X-SVN-Rev: 4169
This commit is contained in:
parent
ef1abeabce
commit
87b88e71e7
@ -307,6 +307,19 @@ UnicodeStringTest::TestExtract()
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// test preflighting and overflows with invariant conversion
|
||||
if (test1.extract(0, 10, (char *)NULL, "") != 10) {
|
||||
errln("UnicodeString.extract(0, 10, (char *)NULL, \"\") != 10");
|
||||
}
|
||||
|
||||
test4[2] = (char)0xff;
|
||||
if (test1.extract(0, 10, test4, 2, "") != 2) {
|
||||
errln("UnicodeString.extract(0, 10, test4, 2, \"\") != 2");
|
||||
}
|
||||
if (test4[2] != (char)0xff) {
|
||||
errln("UnicodeString.extract(0, 10, test4, 2, \"\") overwrote test4[2]");
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user