MCPcopy
hub / github.com/RoaringBitmap/roaring / validate

Function validate

roaring_test.go:2643–2666  ·  view source on GitHub ↗
(t *testing.T, bc *bitmapContainer, ac *arrayContainer)

Source from the content-addressed store, hash-verified

2641}
2642
2643func validate(t *testing.T, bc *bitmapContainer, ac *arrayContainer) {
2644 // Checking the cardinalities of each container
2645 t.Helper()
2646
2647 if bc.getCardinality() != ac.getCardinality() {
2648 t.Error("cardinality differs")
2649 }
2650 // Checking that the two containers contain the same values
2651 counter := 0
2652
2653 for i := bc.NextSetBit(0); i >= 0; i = bc.NextSetBit(uint(i) + 1) {
2654 counter++
2655 if !ac.contains(uint16(i)) {
2656 t.Log("content differs")
2657 t.Log(bc)
2658 t.Log(ac)
2659 t.Fail()
2660 }
2661
2662 }
2663
2664 // checking the cardinality of the BitmapContainer
2665 assert.Equal(t, counter, bc.getCardinality())
2666}
2667
2668func TestRoaringArray(t *testing.T) {
2669 a := newRoaringArray()

Callers 2

TestBitmapCOWFunction · 0.85
TestBitmapFunction · 0.85

Calls 3

NextSetBitMethod · 0.80
getCardinalityMethod · 0.65
containsMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…