From bebded0a7a1e0e3b679e6fcc28f938ecfaefb345 Mon Sep 17 00:00:00 2001 From: David Wayne Smiley Date: Wed, 11 Feb 2015 19:13:01 +0000 Subject: [PATCH] LUCENE-6191: fix test bug when given 0-area input git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1659041 13f79535-47bb-0310-9956-ffa450edef68 --- .../lucene/spatial/prefix/HeatmapFacetCounterTest.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lucene/spatial/src/test/org/apache/lucene/spatial/prefix/HeatmapFacetCounterTest.java b/lucene/spatial/src/test/org/apache/lucene/spatial/prefix/HeatmapFacetCounterTest.java index 7834c4fbb41..42f7524f8b1 100644 --- a/lucene/spatial/src/test/org/apache/lucene/spatial/prefix/HeatmapFacetCounterTest.java +++ b/lucene/spatial/src/test/org/apache/lucene/spatial/prefix/HeatmapFacetCounterTest.java @@ -78,6 +78,7 @@ public class HeatmapFacetCounterTest extends StrategyTestCase { validateHeatmapResultLoop(ctx.makeRectangle(+170, +180, -90, -85), 1, 100); validateHeatmapResultLoop(ctx.makeRectangle(-180, -160, -89, -50), 1, 100); + validateHeatmapResultLoop(ctx.makeRectangle(179, 179, -89, -50), 1, 100);//line // We could test anything and everything at this point... I prefer we leave that to random testing and then // add specific tests if we find a bug. } @@ -179,6 +180,11 @@ public class HeatmapFacetCounterTest extends StrategyTestCase { /** Build heatmap, validate results, then descend recursively to another facet level. */ private boolean queryHeatmapRecursive(Rectangle inputRange, int facetLevel) throws IOException { + if (!inputRange.hasArea()) { + // Don't test line inputs. It's not that we don't support it but it is more challenging to test if per-chance it + // coincides with a grid line due due to edge overlap issue for some grid implementations (geo & quad). + return false; + } Filter filter = null; //FYI testing filtering of underlying PrefixTreeFacetCounter is done in another test //Calculate facets final int maxCells = 10_000;