MCPcopy Create free account
hub / github.com/ByteStorage/FlyDB / TestBitmapStructure_BitCount

Function TestBitmapStructure_BitCount

structure/bitmap_test.go:116–128  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

114}
115
116func TestBitmapStructure_BitCount(t *testing.T) {
117 bm := initBitmap()
118
119 err := bm.SetBits("1", 2, 3, 4, 5, 6, 10, 11, 12, 13, 14, 15)
120 assert.NoError(t, err)
121 count, err := bm.BitCount("1", 3, 10)
122 assert.NoError(t, err)
123 assert.Equal(t, uint(5), count)
124 // check over the end
125 count, err = bm.BitCount("1", 10, 100)
126 assert.NoError(t, err)
127 assert.Equal(t, uint(6), count)
128}
129
130func TestBitmapStructure_BitOp(t *testing.T) {
131 type bitmapStruct struct {

Callers

nothing calls this directly

Calls 3

initBitmapFunction · 0.85
SetBitsMethod · 0.45
BitCountMethod · 0.45

Tested by

no test coverage detected