lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r1360205 - /lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestCodecs.java
Date Wed, 11 Jul 2012 14:36:06 GMT
Author: mikemccand
Date: Wed Jul 11 14:36:06 2012
New Revision: 1360205

URL: http://svn.apache.org/viewvc?rev=1360205&view=rev
Log:
fix test: don't call .nextDoc() if the enum had already returned NO_MORE_DOCS

Modified:
    lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestCodecs.java

Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestCodecs.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestCodecs.java?rev=1360205&r1=1360204&r2=1360205&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestCodecs.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestCodecs.java Wed Jul
11 14:36:06 2012
@@ -559,6 +559,7 @@ public class TestCodecs extends LuceneTe
             }
             assertNotNull(docs);
             int upto2 = -1;
+            boolean ended = false;
             while(upto2 < term.docs.length-1) {
               // Maybe skip:
               final int left = term.docs.length-upto2;
@@ -574,6 +575,7 @@ public class TestCodecs extends LuceneTe
                   if (doc == DocIdSetIterator.NO_MORE_DOCS) {
                     // skipped past last doc
                     assert upto2 == term.docs.length-1;
+                    ended = true;
                     break;
                   } else {
                     // skipped to next doc
@@ -597,7 +599,9 @@ public class TestCodecs extends LuceneTe
               }
             }
 
-            assertEquals(DocIdSetIterator.NO_MORE_DOCS, docs.nextDoc());
+            if (!ended) {
+              assertEquals(DocIdSetIterator.NO_MORE_DOCS, docs.nextDoc());
+            }
           }
           upto++;
 



Mime
View raw message