mirror of https://github.com/apache/lucene.git
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:
parent
2cb14e923c
commit
ca7b037934
|
@ -1583,6 +1583,10 @@ public class CheckIndex implements Closeable {
|
||||||
for(int i=seekCount-1;i>=0;i--) {
|
for(int i=seekCount-1;i>=0;i--) {
|
||||||
long ord = i*(termCount/seekCount);
|
long ord = i*(termCount/seekCount);
|
||||||
termsEnum.seekExact(ord);
|
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());
|
seekTerms[i] = BytesRef.deepCopyOf(termsEnum.term());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1134,6 +1134,9 @@ public class RandomPostingsTester {
|
||||||
termsEnum.seekExact(fieldAndTerm.term, termState);
|
termsEnum.seekExact(fieldAndTerm.term, termState);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check we really seeked to the right place
|
||||||
|
assertEquals(fieldAndTerm.term, termsEnum.term());
|
||||||
|
|
||||||
long termOrd;
|
long termOrd;
|
||||||
if (supportsOrds) {
|
if (supportsOrds) {
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue