Add comment explaining bytes reference edge case
This commit is contained in:
parent
e079c83020
commit
04a4bcdca0
|
@ -394,7 +394,7 @@ public abstract class AbstractBytesReferenceTestCase extends ESTestCase {
|
||||||
public void testSliceArrayOffset() throws IOException {
|
public void testSliceArrayOffset() throws IOException {
|
||||||
int length = randomInt(PAGE_SIZE * randomIntBetween(2, 5));
|
int length = randomInt(PAGE_SIZE * randomIntBetween(2, 5));
|
||||||
BytesReference pbr = newBytesReference(length);
|
BytesReference pbr = newBytesReference(length);
|
||||||
int sliceOffset = randomIntBetween(0, pbr.length() - 1);
|
int sliceOffset = randomIntBetween(0, pbr.length() - 1); // an offset to the end would be len 0
|
||||||
int sliceLength = randomIntBetween(pbr.length() - sliceOffset, pbr.length() - sliceOffset);
|
int sliceLength = randomIntBetween(pbr.length() - sliceOffset, pbr.length() - sliceOffset);
|
||||||
BytesReference slice = pbr.slice(sliceOffset, sliceLength);
|
BytesReference slice = pbr.slice(sliceOffset, sliceLength);
|
||||||
if (slice.hasArray()) {
|
if (slice.hasArray()) {
|
||||||
|
|
Loading…
Reference in New Issue