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

Function TestBitMapStructure_BitCount

structure/bitmap_1_test.go:64–74  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

62}
63
64func TestBitMapStructure_BitCount(t *testing.T) {
65 bitmap := initBitMap()
66 defer bitmap.db.Clean()
67
68 // Test BitCount function
69 bitmapErr = bitmap.SetBits(string(randkv.GetTestKey(1)), 0, true, 1, false, 2, true)
70 assert.Nil(t, bitmapErr)
71 count, err := bitmap.BitCount(string(randkv.GetTestKey(1)), 0, 2)
72 assert.Nil(t, err)
73 assert.Equal(t, 2, count)
74}
75
76func TestBitMapStructure_BitOp(t *testing.T) {
77 bitmap := initBitMap()

Callers

nothing calls this directly

Calls 5

GetTestKeyFunction · 0.92
initBitMapFunction · 0.85
CleanMethod · 0.45
SetBitsMethod · 0.45
BitCountMethod · 0.45

Tested by

no test coverage detected