You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ab...@apache.org on 2018/05/15 20:04:32 UTC

[15/39] lucene-solr:jira/solr-11779: [TEST] Never oversize bitset

[TEST] Never oversize bitset


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

Branch: refs/heads/jira/solr-11779
Commit: 4177252a10fc1cc82e507cc34841814af7fb1ec6
Parents: a3c8637
Author: Simon Willnauer <si...@apache.org>
Authored: Wed May 9 19:10:36 2018 +0200
Committer: Simon Willnauer <si...@apache.org>
Committed: Wed May 9 19:11:13 2018 +0200

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


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/4177252a/lucene/core/src/test/org/apache/lucene/util/TestFixedBitSet.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/util/TestFixedBitSet.java b/lucene/core/src/test/org/apache/lucene/util/TestFixedBitSet.java
index 3b80540..25c7e41 100644
--- a/lucene/core/src/test/org/apache/lucene/util/TestFixedBitSet.java
+++ b/lucene/core/src/test/org/apache/lucene/util/TestFixedBitSet.java
@@ -499,8 +499,10 @@ public class TestFixedBitSet extends BaseBitSetTestCase<FixedBitSet> {
     int numBits = TestUtil.nextInt(random, 1000, 2000);
     int count = TestUtil.nextInt(random, 0, numBits - 1);
     int[] bits = makeIntArray(random, count, 0, numBits - 1);
-    FixedBitSet fixedBitSet = makeFixedBitSet(bits, numBits);
-
+    FixedBitSet fixedBitSet = new FixedBitSet(numBits);
+    for (int e : bits) {
+      fixedBitSet.set(e);
+    }
     FixedBitSet mutableCopy = FixedBitSet.copyOf(fixedBitSet);
     assertNotSame(mutableCopy, fixedBitSet);
     assertEquals(mutableCopy, fixedBitSet);