lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uschind...@apache.org
Subject svn commit: r886339 - /lucene/java/branches/flex_1458/src/test/org/apache/lucene/search/TestNumericRangeQuery32.java
Date Wed, 02 Dec 2009 23:27:49 GMT
Author: uschindler
Date: Wed Dec  2 23:27:49 2009
New Revision: 886339

URL: http://svn.apache.org/viewvc?rev=886339&view=rev
Log:
Fix the NRQ TermsEnum test after merge. The count was wrong because after initializing the
TermsEnum it is already on first term. So the first check must be !empty()

Modified:
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/search/TestNumericRangeQuery32.java

Modified: lucene/java/branches/flex_1458/src/test/org/apache/lucene/search/TestNumericRangeQuery32.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/test/org/apache/lucene/search/TestNumericRangeQuery32.java?rev=886339&r1=886338&r2=886339&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/test/org/apache/lucene/search/TestNumericRangeQuery32.java
(original)
+++ lucene/java/branches/flex_1458/src/test/org/apache/lucene/search/TestNumericRangeQuery32.java
Wed Dec  2 23:27:49 2009
@@ -443,9 +443,8 @@
     NumericRangeQuery<Integer> q = NumericRangeQuery.newIntRange("field4", 4,
         lower, upper, true, true);
     FilteredTermsEnum termEnum = q.getTermsEnum(searcher.getIndexReader());
-    //nocommit: double check this merge 'fix'
     int count = 0;
-    if (termEnum.next() != null) {
+    if (!termEnum.empty()) {
       do {
         final TermRef t = termEnum.term();
         if (t != null) {
@@ -457,7 +456,7 @@
           break;
       } while (termEnum.next() != null);
     }
-    assertFalse(termEnum.next() != null);
+    assertNotNull(termEnum.next());
     System.out.println("TermEnum on 'field4' for range [" + lower + "," + upper
         + "] contained " + count + " terms.");
 



Mime
View raw message