extended bitmap contains test coverage

This commit is contained in:
Todd Gruben 2017-06-22 10:58:47 -05:00
parent 3424211992
commit 188a4aa8d9

View file

@ -651,6 +651,7 @@ func testBM() *roaring.Bitmap {
for i := uint64(0); i < 65535; i += 1 {
bm.Add((4 << 16) + i)
}
bm.Optimize()
//count 75007
return bm
}
@ -668,6 +669,19 @@ func TestBitmapOffsetRange(t *testing.T) {
}
}
func TestBitmapContains(t *testing.T) {
bm := testBM()
//search for run value present
if found := bm.Contains(3 << 16); !found {
t.Fatalf("Test #1 Not Found %d ", 3<<16)
}
//search for value not present
if found := bm.Contains((3 << 16) + 2048); found {
t.Fatalf("Test #2 Found %d ", (3<<16)+2048)
}
}
func TestBitmapBufIterator(t *testing.T) {