MCPcopy Create free account
hub / github.com/DeAI-Artist/Linkis / randBitArray

Function randBitArray

libs/bits/bit_array_test.go:15–28  ·  view source on GitHub ↗
(bits int)

Source from the content-addressed store, hash-verified

13)
14
15func randBitArray(bits int) (*BitArray, []byte) {
16 src := tmrand.Bytes((bits + 7) / 8)
17 bA := NewBitArray(bits)
18 for i := 0; i < len(src); i++ {
19 for j := 0; j < 8; j++ {
20 if i*8+j >= bits {
21 return bA, src
22 }
23 setBit := src[i]&(1<<uint(j)) > 0
24 bA.SetIndex(i*8+j, setBit)
25 }
26 }
27 return bA, src
28}
29
30func TestAnd(t *testing.T) {
31

Callers 3

TestAndFunction · 0.85
TestOrFunction · 0.85
TestUpdateNeverPanicsFunction · 0.85

Calls 3

SetIndexMethod · 0.95
NewBitArrayFunction · 0.85
BytesMethod · 0.65

Tested by

no test coverage detected