You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by cp...@apache.org on 2017/09/06 09:39:24 UTC
[22/50] lucene-solr:jira/solr-10990: LUCENE-7933: relax test to also
pass on 32 bit JVMs
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/jira/solr-10990
Commit: cd471cc98dcee4f587739b2288e4e120f8c54808
Parents: 0807708
Author: Mike McCandless <mi...@apache.org>
Authored: Sat Sep 2 05:41:06 2017 -0400
Committer: Mike McCandless <mi...@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);
}
}