(t *testing.T)
| 254 | } |
| 255 | |
| 256 | func TestBitmapSelectCOW(t *testing.T) { |
| 257 | for N := uint32(1); N <= 1048576; N *= 2 { |
| 258 | t.Run("rank tests"+strconv.Itoa(int(N)), func(t *testing.T) { |
| 259 | for gap := uint32(1); gap <= 65536; gap *= 2 { |
| 260 | rb1 := NewBitmap() |
| 261 | rb1.SetCopyOnWrite(true) |
| 262 | for x := uint32(0); x <= N; x += gap { |
| 263 | rb1.Add(x) |
| 264 | } |
| 265 | for y := uint32(0); y <= N/gap; y++ { |
| 266 | expectedInt := y * gap |
| 267 | i, err := rb1.Select(y) |
| 268 | if err != nil { |
| 269 | t.Fatal(err) |
| 270 | } |
| 271 | |
| 272 | if i != expectedInt { |
| 273 | assert.Equal(t, expectedInt, i) |
| 274 | } |
| 275 | } |
| 276 | } |
| 277 | }) |
| 278 | } |
| 279 | } |
| 280 | |
| 281 | // some extra tests |
| 282 | func TestBitmapExtraCOW(t *testing.T) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…