From 370f2d3488f11a70b06453b43ffd779e2844e1e2 Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Wed, 6 Apr 2016 14:17:34 -0400 Subject: [PATCH] don't test LatLonPoint's quantization with epsilons: demand exact answers --- .../apache/lucene/document/LatLonPoint.java | 9 +- .../lucene/document/TestLatLonPoint.java | 267 +++++++----------- 2 files changed, 107 insertions(+), 169 deletions(-) diff --git a/lucene/sandbox/src/java/org/apache/lucene/document/LatLonPoint.java b/lucene/sandbox/src/java/org/apache/lucene/document/LatLonPoint.java index 0d8a7b2b774..107d83cb877 100644 --- a/lucene/sandbox/src/java/org/apache/lucene/document/LatLonPoint.java +++ b/lucene/sandbox/src/java/org/apache/lucene/document/LatLonPoint.java @@ -46,8 +46,9 @@ import org.apache.lucene.geo.Polygon; *
  • {@link #newPolygonQuery newPolygonQuery()} for matching points within an arbitrary polygon. * *

    - * WARNING: Values are indexed with some loss of precision, incurring up to 1E-7 error from the - * original {@code double} values. + * WARNING: Values are indexed with some loss of precision from the + * original {@code double} values (4.190951585769653E-8 for the latitude component + * and 8.381903171539307E-8 for longitude). * @see PointValues */ // TODO ^^^ that is very sandy and hurts the API, usage, and tests tremendously, because what the user passes @@ -98,9 +99,9 @@ public class LatLonPoint extends Field { private static final int BITS = 32; private static final double LONGITUDE_MUL = (0x1L<", LatLonPoint.newDistanceSort("field", 18.0, 19.0).toString()); } - - public void testEncodeDecode() throws Exception { - // just for testing quantization error - final double ENCODING_TOLERANCE = 1e-7; - int iters = atLeast(10000); - for(int iter=0;iter