ICU-5374 fix module test failure

X-SVN-Rev: 20310
This commit is contained in:
Ram Viswanadha 2006-09-12 21:42:15 +00:00
parent 311067b95b
commit 6e73847d8c

View File

@ -1386,28 +1386,33 @@ public class UnicodeSetTest extends TestFmwk {
}; };
public void TestPrettyPrinting() { public void TestPrettyPrinting() {
PrettyPrinter pp = new PrettyPrinter(); try{
int i = 0; PrettyPrinter pp = new PrettyPrinter();
for (; i < prettyData.length; ++i) {
UnicodeSet test = new UnicodeSet(prettyData[i]); int i = 0;
checkPrettySet(pp, i, test); for (; i < prettyData.length; ++i) {
} UnicodeSet test = new UnicodeSet(prettyData[i]);
Random random = new Random(0); checkPrettySet(pp, i, test);
UnicodeSet test = new UnicodeSet();
for (; i < 1000; ++i) {
double start = random.nextGaussian() * 0x10000;
if (start < 0) start = - start;
if (start > 0x10FFFF) {
start = 0x10FFFF;
} }
double end = random.nextGaussian() * 0x100; Random random = new Random(0);
if (end < 0) end = -end; UnicodeSet test = new UnicodeSet();
end = start + end; for (; i < 1000; ++i) {
if (end > 0x10FFFF) { double start = random.nextGaussian() * 0x10000;
end = 0x10FFFF; if (start < 0) start = - start;
if (start > 0x10FFFF) {
start = 0x10FFFF;
}
double end = random.nextGaussian() * 0x100;
if (end < 0) end = -end;
end = start + end;
if (end > 0x10FFFF) {
end = 0x10FFFF;
}
test.complement((int)start, (int)end);
checkPrettySet(pp, i, test);
} }
test.complement((int)start, (int)end); }catch(RuntimeException ex){
checkPrettySet(pp, i, test); warnln("Could not load Collator");
} }
} }