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/03/28 22:00:07 UTC

lucene-solr:master: this test uses NaN to mean missing. don't try to quantize it.

Repository: lucene-solr
Updated Branches:
  refs/heads/master 9189bdc1c -> 7476d0622


this test uses NaN to mean missing. don't try to quantize it.


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

Branch: refs/heads/master
Commit: 7476d0622f243cd2441f1428c62206ef431eb184
Parents: 9189bdc
Author: Robert Muir <rm...@apache.org>
Authored: Mon Mar 28 16:02:02 2016 -0400
Committer: Robert Muir <rm...@apache.org>
Committed: Mon Mar 28 16:02:02 2016 -0400

----------------------------------------------------------------------
 .../apache/lucene/spatial/util/BaseGeoPointTestCase.java    | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/7476d062/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 021d638..0d6b5bd 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
@@ -726,11 +726,16 @@ public abstract class BaseGeoPointTestCase extends LuceneTestCase {
 
   private void verify(boolean small, double[] lats, double[] lons) throws Exception {
     // quantize each value the same way the index does
+    // NaN means missing for the doc!!!!!
     for (int i = 0; i < lats.length; i++) {
-      lats[i] = quantizeLat(lats[i]);
+      if (!Double.isNaN(lats[i])) {
+        lats[i] = quantizeLat(lats[i]);
+      }
     }
     for (int i = 0; i < lons.length; i++) {
-      lons[i] = quantizeLon(lons[i]);
+      if (!Double.isNaN(lons[i])) {
+        lons[i] = quantizeLon(lons[i]);
+      }
     }
     verifyRandomRectangles(small, lats, lons);
     verifyRandomDistances(small, lats, lons);