mirror of https://github.com/apache/lucene.git
fix test: don't call .nextDoc() if the enum had already returned NO_MORE_DOCS
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1360205 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
04bc7ee821
commit
aa87124205
lucene/core/src/test/org/apache/lucene/index
|
@ -559,6 +559,7 @@ public class TestCodecs extends LuceneTestCase {
|
|||
}
|
||||
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 LuceneTestCase {
|
|||
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 LuceneTestCase {
|
|||
}
|
||||
}
|
||||
|
||||
assertEquals(DocIdSetIterator.NO_MORE_DOCS, docs.nextDoc());
|
||||
if (!ended) {
|
||||
assertEquals(DocIdSetIterator.NO_MORE_DOCS, docs.nextDoc());
|
||||
}
|
||||
}
|
||||
upto++;
|
||||
|
||||
|
|
Loading…
Reference in New Issue