(t *testing.T, bc *bitmapContainer, ac *arrayContainer)
| 2641 | } |
| 2642 | |
| 2643 | func 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 | |
| 2668 | func TestRoaringArray(t *testing.T) { |
| 2669 | a := newRoaringArray() |
no test coverage detected
searching dependent graphs…