BytesArray tests fix: offsets don't matter on a zero bytes array

Closes #19582
This commit is contained in:
Ali Beyad 2016-07-25 15:22:08 -04:00
parent a9ab095b8c
commit 2f831c3abb
1 changed files with 1 additions and 1 deletions

View File

@ -430,7 +430,7 @@ public abstract class AbstractBytesReferenceTestCase extends ESTestCase {
int length = randomInt(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(0, pbr.length() - sliceOffset);
int sliceLength = randomIntBetween(1, pbr.length() - sliceOffset);
BytesReference slice = pbr.slice(sliceOffset, sliceLength);
BytesRef singlePageOrNull = getSinglePageOrNull(slice);
if (singlePageOrNull != null) {