You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by mi...@apache.org on 2013/07/29 20:23:29 UTC
svn commit: r1508162 -
/lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/BasePostingsFormatTestCase.java
Author: mikemccand
Date: Mon Jul 29 18:23:29 2013
New Revision: 1508162
URL: http://svn.apache.org/r1508162
Log:
evil up this test a bit
Modified:
lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/BasePostingsFormatTestCase.java
Modified: lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/BasePostingsFormatTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/BasePostingsFormatTestCase.java?rev=1508162&r1=1508161&r2=1508162&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/BasePostingsFormatTestCase.java (original)
+++ lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/BasePostingsFormatTestCase.java Mon Jul 29 18:23:29 2013
@@ -355,9 +355,12 @@ public abstract class BasePostingsFormat
fields.put(field, postings);
Set<String> seenTerms = new HashSet<String>();
- // TODO:
- //final int numTerms = atLeast(10);
- final int numTerms = 4;
+ int numTerms;
+ if (random().nextInt(10) == 7) {
+ numTerms = atLeast(50);
+ } else {
+ numTerms = _TestUtil.nextInt(random(), 2, 20);
+ }
for(int termUpto=0;termUpto<numTerms;termUpto++) {
String term = _TestUtil.randomSimpleString(random());
@@ -597,6 +600,10 @@ public abstract class BasePostingsFormat
System.out.println(" verifyEnum: options=" + options + " maxTestOptions=" + maxTestOptions);
}
+ // Make sure TermsEnum really is positioned on the
+ // expected term:
+ assertEquals(term, termsEnum.term());
+
// 50% of the time time pass liveDocs:
boolean useLiveDocs = options.contains(Option.LIVE_DOCS) && random().nextBoolean();
Bits liveDocs;