8211266: [TESTBUG] ZipFSTester.java failed intermittently in ZipFSTester.checkRead(): bound must be positive
Reviewed-by: lancea
This commit is contained in:
parent
a90e7ef6d1
commit
59529caf8f
@ -484,8 +484,12 @@ public class ZipFSTester {
|
|||||||
byte[] buf = new byte[1024];
|
byte[] buf = new byte[1024];
|
||||||
ByteBuffer bb = ByteBuffer.wrap(buf);
|
ByteBuffer bb = ByteBuffer.wrap(buf);
|
||||||
for (int i = 0; i < 10; i++) {
|
for (int i = 0; i < 10; i++) {
|
||||||
int pos = rdm.nextInt((int)sbc.size());
|
int pos = 0;
|
||||||
int len = rdm.nextInt(Math.min(buf.length, expected.length - pos));
|
int len = 0;
|
||||||
|
if (expected.length > 0) {
|
||||||
|
pos = rdm.nextInt((int) sbc.size());
|
||||||
|
len = rdm.nextInt(Math.min(buf.length, expected.length - pos));
|
||||||
|
}
|
||||||
// System.out.printf(" --> %d, %d%n", pos, len);
|
// System.out.printf(" --> %d, %d%n", pos, len);
|
||||||
bb.position(0).limit(len); // bb.flip().limit(len);
|
bb.position(0).limit(len); // bb.flip().limit(len);
|
||||||
if (sbc.position(pos).position() != pos ||
|
if (sbc.position(pos).position() != pos ||
|
||||||
|
Loading…
x
Reference in New Issue
Block a user