LUCENE-6529: add asserts

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1683913 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2015-06-06 13:52:40 +00:00
parent 2cb14e923c
commit ca7b037934
2 changed files with 7 additions and 0 deletions

View File

@ -1583,6 +1583,10 @@ public class CheckIndex implements Closeable {
for(int i=seekCount-1;i>=0;i--) {
long ord = i*(termCount/seekCount);
termsEnum.seekExact(ord);
long actualOrd = termsEnum.ord();
if (actualOrd != ord) {
throw new RuntimeException("seek to ord " + ord + " returned ord " + actualOrd);
}
seekTerms[i] = BytesRef.deepCopyOf(termsEnum.term());
}

View File

@ -1134,6 +1134,9 @@ public class RandomPostingsTester {
termsEnum.seekExact(fieldAndTerm.term, termState);
}
// check we really seeked to the right place
assertEquals(fieldAndTerm.term, termsEnum.term());
long termOrd;
if (supportsOrds) {
try {