MCPcopy Create free account
hub / github.com/tendermint/tendermint / randBitArray

Function randBitArray

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

Source from the content-addressed store, hash-verified

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

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

Used in the wild real call sites across dependent graphs

searching dependent graphs…