lucene2 (2.9.4+ds1-4) 12_fix-buildd-failure-in-TestTimeLimitingCollector.dpatch

Summary

 src/test/org/apache/lucene/search/TestTimeLimitedCollector.java  |    3 ++-
 src/test/org/apache/lucene/search/TestTimeLimitingCollector.java |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

    
download this patch

Patch contents

#! /bin/sh /usr/share/dpatch/dpatch-run
## 12_fix-buildd-failure-in-TestTimeLimitingCollector.dpatch by Jan-Pascal van Best <janpascal@vanbest.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: fix bug that causes false positive failure in the test
## DP: Apache Lucene svn revision 834011

@DPATCH@
diff -urNad lucene2~/src/test/org/apache/lucene/search/TestTimeLimitedCollector.java lucene2/src/test/org/apache/lucene/search/TestTimeLimitedCollector.java
--- lucene2~/src/test/org/apache/lucene/search/TestTimeLimitedCollector.java	2009-10-23 17:21:47.000000000 +0200
+++ lucene2/src/test/org/apache/lucene/search/TestTimeLimitedCollector.java	2010-01-22 12:49:03.000000000 +0100
@@ -80,7 +80,8 @@
     searcher = new IndexSearcher(directory);
 
     String qtxt = "one";
-    for (int i = 0; i < docText.length; i++) {
+    // start from 1, so that the 0th doc never matches
+    for (int i = 1; i < docText.length; i++) {
       qtxt += ' ' + docText[i]; // large query so that search will be longer
     }
     QueryParser queryParser = new QueryParser(FIELD_NAME, new WhitespaceAnalyzer());
diff -urNad lucene2~/src/test/org/apache/lucene/search/TestTimeLimitingCollector.java lucene2/src/test/org/apache/lucene/search/TestTimeLimitingCollector.java
--- lucene2~/src/test/org/apache/lucene/search/TestTimeLimitingCollector.java	2009-10-23 17:21:47.000000000 +0200
+++ lucene2/src/test/org/apache/lucene/search/TestTimeLimitingCollector.java	2010-01-22 12:44:21.000000000 +0100
@@ -82,7 +82,8 @@
     searcher = new IndexSearcher(directory);
 
     String qtxt = "one";
-    for (int i = 0; i < docText.length; i++) {
+    // start from 1, so that the 0th doc never matches
+    for (int i = 1; i < docText.length; i++) {
       qtxt += ' ' + docText[i]; // large query so that search will be longer
     }
     QueryParser queryParser = new QueryParser(FIELD_NAME, new WhitespaceAnalyzer());