LUCENE-4211: fix one test bug

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1360977 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2012-07-12 21:56:31 +00:00
parent d6254caf80
commit abf9894023
1 changed files with 3 additions and 2 deletions

View File

@ -171,8 +171,9 @@ public class TestDocsAndPositions extends LuceneTestCase {
}
if (random().nextInt(10) == 0) { // once is a while advance
docsAndPosEnum
.advance(docID + 1 + random().nextInt((maxDoc - docID)));
if (docsAndPosEnum.advance(docID + 1 + random().nextInt((maxDoc - docID))) == DocIdSetIterator.NO_MORE_DOCS) {
break;
}
}
} while (docsAndPosEnum.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);