lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sha...@apache.org
Subject [48/50] lucene-solr:feature/autoscaling: LUCENE-7933: relax test to also pass on 32 bit JVMs
Date Sat, 02 Sep 2017 15:43:19 GMT
LUCENE-7933: relax test to also pass on 32 bit JVMs


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/cd471cc9
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/cd471cc9
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/cd471cc9

Branch: refs/heads/feature/autoscaling
Commit: cd471cc98dcee4f587739b2288e4e120f8c54808
Parents: 0807708
Author: Mike McCandless <mikemccand@apache.org>
Authored: Sat Sep 2 05:41:06 2017 -0400
Committer: Mike McCandless <mikemccand@apache.org>
Committed: Sat Sep 2 05:41:06 2017 -0400

----------------------------------------------------------------------
 .../src/test/org/apache/lucene/util/TestLongBitSet.java   | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/cd471cc9/lucene/core/src/test/org/apache/lucene/util/TestLongBitSet.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/util/TestLongBitSet.java b/lucene/core/src/test/org/apache/lucene/util/TestLongBitSet.java
index f94c97e..5a74855 100644
--- a/lucene/core/src/test/org/apache/lucene/util/TestLongBitSet.java
+++ b/lucene/core/src/test/org/apache/lucene/util/TestLongBitSet.java
@@ -225,7 +225,7 @@ public class TestLongBitSet extends LuceneTestCase {
                                () -> {
                                  new LongBitSet(LongBitSet.MAX_NUM_BITS + 1);
                                });
-    assertEquals("numBits must be 0 .. 137438952384; got: 137438952385", e.getMessage());
+    assertTrue(e.getMessage().startsWith("numBits must be 0 .. "));
   }
 
   public void testNegativeNumBits() {
@@ -233,7 +233,7 @@ public class TestLongBitSet extends LuceneTestCase {
                                () -> {
                                  new LongBitSet(-17);
                                });
-    assertEquals("numBits must be 0 .. 137438952384; got: -17", e.getMessage());
+    assertTrue(e.getMessage().startsWith("numBits must be 0 .. "));
   }
 
   public void testSmallBitSets() {
@@ -360,7 +360,9 @@ public class TestLongBitSet extends LuceneTestCase {
     // ...
     assertEquals(1 << (32-6), LongBitSet.bits2words(1L << 32));
     assertEquals((1 << (32-6)) + 1, LongBitSet.bits2words((1L << 32)) + 1);
-    // ...
-    assertEquals(2147483631, LongBitSet.bits2words(LongBitSet.MAX_NUM_BITS));
+
+    // ensure the claimed max num_bits doesn't throw exc; we can't enforce exact values here
+    // because the value variees with JVM:
+    assertTrue(LongBitSet.bits2words(LongBitSet.MAX_NUM_BITS) > 0);
   }
 }


Mime
View raw message