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:55 UTC
svn commit: r1508163 - in /lucene/dev/branches/branch_4x: ./ lucene/
lucene/test-framework/
lucene/test-framework/src/java/org/apache/lucene/index/BasePostingsFormatTestCase.java
Author: mikemccand
Date: Mon Jul 29 18:23:54 2013
New Revision: 1508163
URL: http://svn.apache.org/r1508163
Log:
evil up this test a bit
Modified:
lucene/dev/branches/branch_4x/ (props changed)
lucene/dev/branches/branch_4x/lucene/ (props changed)
lucene/dev/branches/branch_4x/lucene/test-framework/ (props changed)
lucene/dev/branches/branch_4x/lucene/test-framework/src/java/org/apache/lucene/index/BasePostingsFormatTestCase.java
Modified: lucene/dev/branches/branch_4x/lucene/test-framework/src/java/org/apache/lucene/index/BasePostingsFormatTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/test-framework/src/java/org/apache/lucene/index/BasePostingsFormatTestCase.java?rev=1508163&r1=1508162&r2=1508163&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/test-framework/src/java/org/apache/lucene/index/BasePostingsFormatTestCase.java (original)
+++ lucene/dev/branches/branch_4x/lucene/test-framework/src/java/org/apache/lucene/index/BasePostingsFormatTestCase.java Mon Jul 29 18:23:54 2013
@@ -353,9 +353,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());
@@ -595,6 +598,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;