Apache Lucene open-source search software
LUCENE-2501: strengthen this testcase a bit, but I still can't get it to fail
Michael McCandlessd22876971ef7
diff --git a/lucene/src/test/org/apache/lucene/index/TestByteSlices.java b/lucene/src/test/org/apache/lucene/index/TestByteSlices.javaindex e4e0d3aed23..6faf7c56daf 100644--- a/lucene/src/test/org/apache/lucene/index/TestByteSlices.java+++ b/lucene/src/test/org/apache/lucene/index/TestByteSlices.java@@ -55,7 +55,7 @@ public class TestByteSlices extends LuceneTestCase {public void testBasic() throws Throwable {ByteBlockPool pool = new ByteBlockPool(new ByteBlockAllocator());- final int NUM_STREAM = 25;+ final int NUM_STREAM = 100*_TestUtil.getRandomMultiplier();ByteSliceWriter writer = new ByteSliceWriter(pool);@@ -91,8 +91,9 @@ public class TestByteSlices extends LuceneTestCase {for(int j=0;j<numValue;j++) {if (VERBOSE)System.out.println(" write " + (counters[stream]+j));+ // write some large (incl. negative) ints:+ writer.writeVInt(r.nextInt());writer.writeVInt(counters[stream]+j);- //writer.writeVInt(ti);}counters[stream] += numValue;uptos[stream] = writer.getAddress();@@ -104,11 +105,12 @@ public class TestByteSlices extends LuceneTestCase {if (VERBOSE)System.out.println(" stream=" + stream + " count=" + counters[stream]);- if (starts[stream] != uptos[stream]) {+ if (starts[stream] != -1 && starts[stream] != uptos[stream]) {reader.init(pool, starts[stream], uptos[stream]);- for(int j=0;j<counters[stream];j++)- assertEquals(j, reader.readVInt());- //assertEquals(ti, reader.readVInt());+ for(int j=0;j<counters[stream];j++) {+ reader.readVInt();+ assertEquals(j, reader.readVInt());+ }}}