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

lucene-solr:master: LUCENE-7207: fix test bug. shrinking a box which is a line can create a cross-dateline query!

Repository: lucene-solr
Updated Branches:
  refs/heads/master e034b04b0 -> 8f5ef078b


LUCENE-7207: fix test bug. shrinking a box which is a line can create a cross-dateline query!


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

Branch: refs/heads/master
Commit: 8f5ef078b0af8db1998f5a04a772129fdd5c9f6e
Parents: e034b04
Author: Robert Muir <rm...@apache.org>
Authored: Tue Apr 12 09:27:30 2016 -0400
Committer: Robert Muir <rm...@apache.org>
Committed: Tue Apr 12 09:27:30 2016 -0400

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


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/8f5ef078/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 c2536bd..8daf83f 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
@@ -1271,7 +1271,9 @@ public abstract class BaseGeoPointTestCase extends LuceneTestCase {
     }
     
     // now shrink 1 ulp in each direction if possible: it should not include bogus stuff
-    if (rect.minLat != 90 && rect.maxLat != -90 && rect.minLon != 80 && rect.maxLon != -180) {
+    // we can't shrink if values are already at extremes, and
+    // we can't do this if rectangle is actually a line or we will create a cross-dateline query
+    if (rect.minLat != 90 && rect.maxLat != -90 && rect.minLon != 80 && rect.maxLon != -180 && rect.minLon != rect.maxLon) {
       // note we put points on "sides" not just "corners" so we just shrink all 4 at once for now: it should exclude all points!
       assertEquals(0, s.count(newRectQuery(FIELD_NAME, Math.nextUp(rect.minLat), 
                                                      Math.nextDown(rect.maxLat),