[TEST] fix BytesReference tests to never have a negative slice offset
This commit is contained in:
parent
cce321a560
commit
0afcaf5627
|
@ -432,7 +432,7 @@ public abstract class AbstractBytesReferenceTestCase extends ESTestCase {
|
|||
}
|
||||
|
||||
public void testSliceArrayOffset() throws IOException {
|
||||
int length = randomInt(PAGE_SIZE * randomIntBetween(2, 5));
|
||||
int length = randomIntBetween(1, PAGE_SIZE * randomIntBetween(2, 5));
|
||||
BytesReference pbr = newBytesReference(length);
|
||||
int sliceOffset = randomIntBetween(0, pbr.length() - 1); // an offset to the end would be len 0
|
||||
int sliceLength = randomIntBetween(1, pbr.length() - sliceOffset);
|
||||
|
|
Loading…
Reference in New Issue