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 2015/05/27 11:33:52 UTC

svn commit: r1681941 - /lucene/dev/branches/LUCENE-6481/lucene/sandbox/src/test/org/apache/lucene/search/TestGeoPointQuery.java

Author: mikemccand
Date: Wed May 27 09:33:51 2015
New Revision: 1681941

URL: http://svn.apache.org/r1681941
Log:
LUCENE-6481: sometimes use smallish bbox for random test

Modified:
    lucene/dev/branches/LUCENE-6481/lucene/sandbox/src/test/org/apache/lucene/search/TestGeoPointQuery.java

Modified: lucene/dev/branches/LUCENE-6481/lucene/sandbox/src/test/org/apache/lucene/search/TestGeoPointQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-6481/lucene/sandbox/src/test/org/apache/lucene/search/TestGeoPointQuery.java?rev=1681941&r1=1681940&r2=1681941&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-6481/lucene/sandbox/src/test/org/apache/lucene/search/TestGeoPointQuery.java (original)
+++ lucene/dev/branches/LUCENE-6481/lucene/sandbox/src/test/org/apache/lucene/search/TestGeoPointQuery.java Wed May 27 09:33:51 2015
@@ -61,9 +61,13 @@ public class TestGeoPointQuery extends L
 
   private static final String FIELD_NAME = "geoField";
 
+  private static boolean smallBBox;
+
   @BeforeClass
   public static void beforeClass() throws Exception {
     directory = newDirectory();
+    smallBBox = random().nextBoolean();
+    System.out.println("smallBBox=" + smallBBox);
     RandomIndexWriter writer = new RandomIndexWriter(random(), directory,
             newIndexWriterConfig(new MockAnalyzer(random()))
                     .setMaxBufferedDocs(TestUtil.nextInt(random(), 100, 1000))
@@ -395,10 +399,18 @@ public class TestGeoPointQuery extends L
   }
 
   private static double randomLat() {
-    return -90 + 180.0 * random().nextDouble();
+    if (smallBBox) {
+      return -90 + 2.0 * (random().nextDouble()-0.5);
+    } else {
+      return -90 + 180.0 * random().nextDouble();
+    }
   }
 
   private static double randomLon() {
-    return -180 + 360.0 * random().nextDouble();
+    if (smallBBox) {
+      return -180 + 2.0 * (random().nextDouble()-0.5);
+    } else {
+      return -180 + 360.0 * random().nextDouble();
+    }
   }
 }