You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by iv...@apache.org on 2021/12/06 06:33:39 UTC

[lucene] branch main updated: LUCENE-10233: fix Unit Test TestFixedBitSet#testAndNot (#512)

This is an automated email from the ASF dual-hosted git repository.

ivera pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/lucene.git


The following commit(s) were added to refs/heads/main by this push:
     new 459388c  LUCENE-10233: fix Unit Test TestFixedBitSet#testAndNot (#512)
459388c is described below

commit 459388cfe139e89b6aaccd9610f3e33054bde6c0
Author: gf2121 <52...@users.noreply.github.com>
AuthorDate: Mon Dec 6 14:33:32 2021 +0800

    LUCENE-10233: fix Unit Test TestFixedBitSet#testAndNot (#512)
    
    Co-authored-by: guofeng.my <gu...@bytedance.com>
---
 lucene/core/src/test/org/apache/lucene/util/TestFixedBitSet.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

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 11cf4c0..280ec3e 100644
--- a/lucene/core/src/test/org/apache/lucene/util/TestFixedBitSet.java
+++ b/lucene/core/src/test/org/apache/lucene/util/TestFixedBitSet.java
@@ -456,9 +456,10 @@ public class TestFixedBitSet extends BaseBitSetTestCase<FixedBitSet> {
     int count1 = TestUtil.nextInt(random, 0, numBits1 - 1);
     int count2 = TestUtil.nextInt(random, 0, numBits2 - 1);
 
-    int offSetWord1 = FixedBitSet.bits2words(TestUtil.nextInt(random, 0, count1));
+    int min = TestUtil.nextInt(random, 0, numBits1 - 1);
+    int offSetWord1 = min >> 6;
     int offset1 = offSetWord1 << 6;
-    int[] bits1 = makeIntArray(random, count1, offset1, numBits1 - 1);
+    int[] bits1 = makeIntArray(random, count1, min, numBits1 - 1);
     int[] bits2 = makeIntArray(random, count2, 0, numBits2 - 1);
 
     java.util.BitSet bitSet1 = makeBitSet(bits1);