LUCENE-4149: Fix test case.

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1351231 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Adrien Grand 2012-06-18 08:28:58 +00:00
parent a11013a990
commit 9cb55ddb17
3 changed files with 6 additions and 5 deletions

View File

@ -140,7 +140,7 @@ abstract class Packed64SingleBlock extends PackedInts.MutableImpl {
@Override
public int get(int index, long[] arr, int off, int len) {
assert len > 0;
assert len > 0 : "len must be > 0 (got " + len + ")";
assert index >= 0 && index < valueCount;
len = Math.min(len, valueCount - index);
assert off + len <= arr.length;
@ -192,7 +192,7 @@ abstract class Packed64SingleBlock extends PackedInts.MutableImpl {
@Override
public int set(int index, long[] arr, int off, int len) {
assert len > 0;
assert len > 0 : "len must be > 0 (got " + len + ")";
assert index >= 0 && index < valueCount;
len = Math.min(len, valueCount - index);
assert off + len <= arr.length;

View File

@ -244,6 +244,7 @@ public class PackedInts {
}
public int get(int index, long[] arr, int off, int len) {
assert len > 0 : "len must be > 0 (got " + len + ")";
assert index >= 0 && index < valueCount;
assert off + len <= arr.length;
@ -263,7 +264,7 @@ public class PackedInts {
}
public int set(int index, long[] arr, int off, int len) {
assert len > 0;
assert len > 0 : "len must be > 0 (got " + len + ")";
assert index >= 0 && index < valueCount;
len = Math.min(len, valueCount - index);
assert off + len <= arr.length;

View File

@ -445,7 +445,7 @@ public class TestPackedInts extends LuceneTestCase {
public void testBulkGet() {
final int valueCount = 1111;
final int index = random().nextInt(valueCount);
final int len = random().nextInt(valueCount * 2);
final int len = _TestUtil.nextInt(random(), 1, valueCount * 2);
final int off = random().nextInt(77);
for (int bpv = 1; bpv <= 64; ++bpv) {
@ -479,7 +479,7 @@ public class TestPackedInts extends LuceneTestCase {
public void testBulkSet() {
final int valueCount = 1111;
final int index = random().nextInt(valueCount);
final int len = random().nextInt(valueCount * 2);
final int len = _TestUtil.nextInt(random(), 1, valueCount * 2);
final int off = random().nextInt(77);
long[] arr = new long[off+len];