Skip to content

Apache Lucene open-source search software

LUCENE-7225: Undo unneeded conflict detection logic in test.

Karl Wrightc08f6448412b
diff --git a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/TestGeo3DPoint.java b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/TestGeo3DPoint.java
index a8a7300ee4b..c9c8d968e60 100644
--- a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/TestGeo3DPoint.java
+++ b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/TestGeo3DPoint.java
@@ -794,33 +794,25 @@ public class TestGeo3DPoint extends LuceneTestCase {
GeoPoint unquantizedPoint = unquantizedPoints[id];
if (point != null && unquantizedPoint != null) {
GeoShape shape = ((PointInGeo3DShapeQuery)query).getShape();
- // If there's a conflict, we don't know what 'truth' actually is; either result is OK
- boolean conflict = shape.isWithin(point) != shape.isWithin(unquantizedPoint);
- boolean expected = ((deleted.contains(id) == false) && shape.isWithin(unquantizedPoint));
+ boolean expected = ((deleted.contains(id) == false) && shape.isWithin(point));
if (hits.get(docID) != expected) {
- if (conflict) {
- if (VERBOSE) {
- System.err.println("CONFLICT: id=" + id + " quantized point membership disagrees with non-quantized point: truth unknown");
- }
+ StringBuilder b = new StringBuilder();
+ if (expected) {
+ b.append("FAIL: id=" + id + " should have matched but did not\n");
} else {
- StringBuilder b = new StringBuilder();
- if (expected) {
- b.append("FAIL: id=" + id + " should have matched but did not\n");
- } else {
- b.append("FAIL: id=" + id + " should not have matched but did\n");
- }
- b.append(" shape=" + ((PointInGeo3DShapeQuery)query).getShape() + "\n");
- b.append(" world bounds=(" +
- " minX=" + PlanetModel.WGS84.getMinimumXValue() + " maxX=" + PlanetModel.WGS84.getMaximumXValue() +
- " minY=" + PlanetModel.WGS84.getMinimumYValue() + " maxY=" + PlanetModel.WGS84.getMaximumYValue() +
- " minZ=" + PlanetModel.WGS84.getMinimumZValue() + " maxZ=" + PlanetModel.WGS84.getMaximumZValue() + "\n");
- b.append(" quantized point=" + point + " within shape? "+shape.isWithin(point)+"\n");
- b.append(" unquantized point=" + unquantizedPoint + " within shape? "+shape.isWithin(unquantizedPoint)+"\n");
- b.append(" docID=" + docID + " deleted?=" + deleted.contains(id) + "\n");
- b.append(" query=" + query + "\n");
- b.append(" explanation:\n " + explain("point", shape, point, unquantizedPoint, r, docID).replace("\n", "\n "));
- fail(b.toString());
+ b.append("FAIL: id=" + id + " should not have matched but did\n");
}
+ b.append(" shape=" + ((PointInGeo3DShapeQuery)query).getShape() + "\n");
+ b.append(" world bounds=(" +
+ " minX=" + PlanetModel.WGS84.getMinimumXValue() + " maxX=" + PlanetModel.WGS84.getMaximumXValue() +
+ " minY=" + PlanetModel.WGS84.getMinimumYValue() + " maxY=" + PlanetModel.WGS84.getMaximumYValue() +
+ " minZ=" + PlanetModel.WGS84.getMinimumZValue() + " maxZ=" + PlanetModel.WGS84.getMaximumZValue() + "\n");
+ b.append(" quantized point=" + point + " within shape? "+shape.isWithin(point)+"\n");
+ b.append(" unquantized point=" + unquantizedPoint + " within shape? "+shape.isWithin(unquantizedPoint)+"\n");
+ b.append(" docID=" + docID + " deleted?=" + deleted.contains(id) + "\n");
+ b.append(" query=" + query + "\n");
+ b.append(" explanation:\n " + explain("point", shape, point, unquantizedPoint, r, docID).replace("\n", "\n "));
+ fail(b.toString());
}
} else {
assertFalse(hits.get(docID));