mirror of
https://github.com/apache/lucene.git
synced 2025-02-10 03:55:46 +00:00
[TEST] Never oversize bitset
This commit is contained in:
parent
a3c86373e4
commit
4177252a10
@ -499,8 +499,10 @@ public class TestFixedBitSet extends BaseBitSetTestCase<FixedBitSet> {
|
|||||||
int numBits = TestUtil.nextInt(random, 1000, 2000);
|
int numBits = TestUtil.nextInt(random, 1000, 2000);
|
||||||
int count = TestUtil.nextInt(random, 0, numBits - 1);
|
int count = TestUtil.nextInt(random, 0, numBits - 1);
|
||||||
int[] bits = makeIntArray(random, count, 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);
|
FixedBitSet mutableCopy = FixedBitSet.copyOf(fixedBitSet);
|
||||||
assertNotSame(mutableCopy, fixedBitSet);
|
assertNotSame(mutableCopy, fixedBitSet);
|
||||||
assertEquals(mutableCopy, fixedBitSet);
|
assertEquals(mutableCopy, fixedBitSet);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user