Skip to content

Apache Lucene open-source search software

fix test not to generate nullreaders > 10, since it always asserts bulk reads from that position

Robert Muire579cc68ea26
diff --git a/lucene/core/src/test/org/apache/lucene/util/packed/TestPackedInts.java b/lucene/core/src/test/org/apache/lucene/util/packed/TestPackedInts.java
index 721ed435521..6a8481896bf 100644
--- a/lucene/core/src/test/org/apache/lucene/util/packed/TestPackedInts.java
+++ b/lucene/core/src/test/org/apache/lucene/util/packed/TestPackedInts.java
@@ -541,7 +541,8 @@ public class TestPackedInts extends LuceneTestCase {
}
public void testPackedIntsNull() {
- int size = _TestUtil.nextInt(random(), 0, 256);
+ // must be > 10 for the bulk reads below
+ int size = _TestUtil.nextInt(random(), 11, 256);
Reader packedInts = new PackedInts.NullReader(size);
assertEquals(0, packedInts.get(_TestUtil.nextInt(random(), 0, size - 1)));
long[] arr = new long[size + 10];