You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by th...@apache.org on 2016/04/14 01:22:04 UTC

[48/50] lucene-solr:jira/SOLR-8908: LUCENE-7213: fix test bug when LatLonPoint.newBoxQuery returns MatchNoDocsQuery.

LUCENE-7213: fix test bug when LatLonPoint.newBoxQuery returns MatchNoDocsQuery.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/1a1c8dbf
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/1a1c8dbf
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/1a1c8dbf

Branch: refs/heads/jira/SOLR-8908
Commit: 1a1c8dbfb325176ab471fcec8e739f488945ba9d
Parents: e4dcf42
Author: Robert Muir <rm...@apache.org>
Authored: Wed Apr 13 18:52:32 2016 -0400
Committer: Robert Muir <rm...@apache.org>
Committed: Wed Apr 13 18:52:32 2016 -0400

----------------------------------------------------------------------
 .../org/apache/lucene/spatial/util/BaseGeoPointTestCase.java  | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/1a1c8dbf/lucene/spatial/src/test/org/apache/lucene/spatial/util/BaseGeoPointTestCase.java
----------------------------------------------------------------------
diff --git a/lucene/spatial/src/test/org/apache/lucene/spatial/util/BaseGeoPointTestCase.java b/lucene/spatial/src/test/org/apache/lucene/spatial/util/BaseGeoPointTestCase.java
index 8daf83f..daf3cbd 100644
--- a/lucene/spatial/src/test/org/apache/lucene/spatial/util/BaseGeoPointTestCase.java
+++ b/lucene/spatial/src/test/org/apache/lucene/spatial/util/BaseGeoPointTestCase.java
@@ -54,6 +54,7 @@ import org.apache.lucene.index.SegmentWriteState;
 import org.apache.lucene.index.SerialMergeScheduler;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.search.IndexSearcher;
+import org.apache.lucene.search.MatchNoDocsQuery;
 import org.apache.lucene.search.Query;
 import org.apache.lucene.search.ScoreDoc;
 import org.apache.lucene.search.SimpleCollector;
@@ -1387,7 +1388,11 @@ public abstract class BaseGeoPointTestCase extends LuceneTestCase {
     q1 = newRectQuery("field", rect.minLat, rect.maxLat, rect.minLon, rect.maxLon);
     q2 = newRectQuery("field", rect.minLat, rect.maxLat, rect.minLon, rect.maxLon);
     assertEquals(q1, q2);
-    assertFalse(q1.equals(newRectQuery("field2", rect.minLat, rect.maxLat, rect.minLon, rect.maxLon)));
+    // for "impossible" ranges LatLonPoint.newBoxQuery will return MatchNoDocsQuery
+    // changing the field is unrelated to that.
+    if (q1 instanceof MatchNoDocsQuery == false) {
+      assertFalse(q1.equals(newRectQuery("field2", rect.minLat, rect.maxLat, rect.minLon, rect.maxLon)));
+    }
 
     double lat = randomLat(false);
     double lon = randomLon(false);