Skip to content

Apache Lucene open-source search software

seek checks removed; such ckecks are not implemented by the other subclasses of InputStream either. Unit test adapted accordingly.

Christoph Gollerdfaa46dd93dc
diff --git a/src/test/org/apache/lucene/index/TestCompoundFile.java b/src/test/org/apache/lucene/index/TestCompoundFile.java
index faf821493ce..5b0fc6c4bcb 100644
--- a/src/test/org/apache/lucene/index/TestCompoundFile.java
+++ b/src/test/org/apache/lucene/index/TestCompoundFile.java
@@ -64,6 +64,7 @@ import org.apache.lucene.store.OutputStream;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.InputStream;
import org.apache.lucene.store.FSDirectory;
+import org.apache.lucene.store.RAMDirectory;
import org.apache.lucene.store._TestHelper;
@@ -163,25 +164,8 @@ public class TestCompoundFile extends TestCase
long seekTo)
throws IOException
{
- if (seekTo < 0) {
- try {
- actual.seek(seekTo);
- fail(msg + ", " + seekTo + ", negative seek");
- } catch (IOException e) {
- /* success */
- //System.out.println("SUCCESS: Negative seek: " + e);
- }
-
- } else if (seekTo > 0 && seekTo >= expected.length()) {
- try {
- actual.seek(seekTo);
- fail(msg + ", " + seekTo + ", seek past EOF");
- } catch (IOException e) {
- /* success */
- //System.out.println("SUCCESS: Seek past EOF: " + e);
- }
-
- } else {
+ if(seekTo >= 0 && seekTo < expected.length())
+ {
expected.seek(seekTo);
actual.seek(seekTo);
assertSameStreams(msg + ", seek(mid)", expected, actual);