mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-11 16:03:20 +00:00
ICU-1952 tests for Doug's fix
X-SVN-Rev: 9487
This commit is contained in:
parent
0287aa44ec
commit
a021ec686a
1 changed files with 21 additions and 0 deletions
|
@ -455,5 +455,26 @@ public class TestUCharacterIterator extends TestFmwk{
|
|||
private static final String ITERATION_STRING_ =
|
||||
"Testing 1 2 3 \ud800\udc00 456";
|
||||
private static final int ITERATION_SUPPLEMENTARY_INDEX = 14;
|
||||
|
||||
public void TestJitterbug1952(){
|
||||
//test previous code point
|
||||
char[] src = new char[]{ '\uDC00','\uD800','\uDC01','\uD802','\uDC02','\uDC03'};
|
||||
UCharacterIterator iter = UCharacterIterator.getInstance(src);
|
||||
iter.setIndex(1);
|
||||
int ch;
|
||||
// this should never go into a infinite loop
|
||||
// if it does then we have a problem
|
||||
while((ch=iter.previousCodePoint())!=iter.DONE){
|
||||
if(ch!=0xDc00){
|
||||
errln("iter.previousCodePoint() failed");
|
||||
}
|
||||
}
|
||||
iter.setIndex(5);
|
||||
while((ch=iter.nextCodePoint()) !=iter.DONE){
|
||||
if(ch!= 0xDC03){
|
||||
errln("iter.nextCodePoint() failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue