(bits int)
| 15 | ) |
| 16 | |
| 17 | func 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 | |
| 32 | func TestAnd(t *testing.T) { |
| 33 |
no test coverage detected
searching dependent graphs…