fix test bug: don't try to seek past number of ords

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1618136 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2014-08-15 10:10:57 +00:00
parent a25f04d4e7
commit 7b44edbb82
1 changed files with 4 additions and 2 deletions

View File

@ -178,9 +178,10 @@ public class TestLucene410DocValuesFormat extends BaseCompressingDocValuesFormat
AtomicReader r = context.reader();
Terms terms = r.terms("indexed");
if (terms != null) {
assertEquals(terms.size(), r.getSortedSetDocValues("dv").getValueCount());
TermsEnum expected = terms.iterator(null);
TermsEnum actual = r.getSortedSetDocValues("dv").termsEnum();
assertEquals(r.maxDoc(), expected, actual);
assertEquals(terms.size(), expected, actual);
}
}
ir.close();
@ -192,9 +193,10 @@ public class TestLucene410DocValuesFormat extends BaseCompressingDocValuesFormat
AtomicReader ar = getOnlySegmentReader(ir);
Terms terms = ar.terms("indexed");
if (terms != null) {
assertEquals(terms.size(), ar.getSortedSetDocValues("dv").getValueCount());
TermsEnum expected = terms.iterator(null);
TermsEnum actual = ar.getSortedSetDocValues("dv").termsEnum();
assertEquals(ar.maxDoc(), expected, actual);
assertEquals(terms.size(), expected, actual);
}
ir.close();