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

Function TestBitMapValidation

roaring_test.go:3355–3377  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

3353}
3354
3355func TestBitMapValidation(t *testing.T) {
3356 bm := NewBitmap()
3357 bm.AddRange(0, 100)
3358 bm.AddRange(306, 406)
3359 bm.AddRange(102, 202)
3360 bm.AddRange(204, 304)
3361 assert.NoError(t, bm.Validate())
3362
3363 randomEntries := make([]uint32, 0, 1000)
3364 for i := 0; i < 1000; i++ {
3365 randomEntries = append(randomEntries, rand.Uint32())
3366 }
3367
3368 bm.AddMany(randomEntries)
3369 assert.NoError(t, bm.Validate())
3370
3371 randomEntries = make([]uint32, 0, 1000)
3372 for i := 0; i < 1000; i++ {
3373 randomEntries = append(randomEntries, uint32(i))
3374 }
3375 bm.AddMany(randomEntries)
3376 assert.NoError(t, bm.Validate())
3377}
3378
3379func TestBitMapValidationFromDeserialization(t *testing.T) {
3380 // To understand what is going on here, read https://github.com/RoaringBitmap/RoaringFormatSpec

Callers

nothing calls this directly

Calls 4

AddRangeMethod · 0.95
ValidateMethod · 0.95
AddManyMethod · 0.95
NewBitmapFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…