[TEST] fix BytesReference tests to never have a negative slice offset

This commit is contained in:
Ali Beyad 2017-04-13 16:16:04 -04:00
parent cce321a560
commit 0afcaf5627
1 changed files with 1 additions and 1 deletions

View File

@ -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);