You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by mi...@apache.org on 2016/06/07 11:57:06 UTC
lucene-solr:master: LUCENE-7316: improve test
Repository: lucene-solr
Updated Branches:
refs/heads/master d74db527b -> ff8c42a70
LUCENE-7316: improve test
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/ff8c42a7
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/ff8c42a7
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/ff8c42a7
Branch: refs/heads/master
Commit: ff8c42a70dcb82aab34406f643f1e2a599b703ef
Parents: d74db52
Author: Mike McCandless <mi...@apache.org>
Authored: Tue Jun 7 07:56:53 2016 -0400
Committer: Mike McCandless <mi...@apache.org>
Committed: Tue Jun 7 07:56:53 2016 -0400
----------------------------------------------------------------------
.../apache/lucene/spatial3d/TestGeo3DPoint.java | 24 +++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ff8c42a7/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/TestGeo3DPoint.java
----------------------------------------------------------------------
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 5819ded..85ec548 100644
--- a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/TestGeo3DPoint.java
+++ b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/TestGeo3DPoint.java
@@ -238,6 +238,29 @@ public class TestGeo3DPoint extends LuceneTestCase {
log.println(" root cell: " + root);
}
+ // make sure the root cell (XYZBounds) does in fact contain all points that the shape contains
+ {
+ boolean fail = false;
+ for(int docID=0;docID<numDocs;docID++) {
+ if (root.contains(docs[docID]) == false) {
+ boolean expected = shape.isWithin(unquantizedDocs[docID]);
+ if (expected) {
+ log.println(" doc=" + docID + " is contained by shape but is outside the returned XYZBounds");
+ log.println(" unquantized=" + unquantizedDocs[docID]);
+ log.println(" quantized=" + docs[docID]);
+ fail = true;
+ }
+ }
+ }
+
+ if (fail) {
+ log.println(" shape=" + shape);
+ log.println(" bounds=" + bounds);
+ System.out.print(sw.toString());
+ fail("invalid bounds for shape=" + shape);
+ }
+ }
+
List<Cell> queue = new ArrayList<>();
queue.add(root);
Set<Integer> hits = new HashSet<>();
@@ -1201,7 +1224,6 @@ public class TestGeo3DPoint extends LuceneTestCase {
if (encoded != Integer.MAX_VALUE) {
// this is the next representable value
// all double values between [min .. max) should encode to the current integer
- // all double values between (min .. max] should encodeCeil to the next integer.
double max = min + Geo3DUtil.DECODE;
assertEquals(max, Geo3DUtil.decodeValueFloor(encoded+1), 0.0D);
assertEquals(encoded+1, Geo3DUtil.encodeValue(max));