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

Function TestIssue396

serialization_test.go:592–609  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

590}
591
592func TestIssue396(t *testing.T) {
593 id := uint64(100000)
594 bitmap := NewBitmap()
595 for i := uint64(0); i < id; i++ {
596 if i%2 == 0 {
597 bitmap.Add(uint32(i))
598 }
599 }
600 bitmapBytes, err := bitmap.MarshalBinary()
601 require.Nil(t, err)
602
603 bitmapUnmarshalled := NewBitmap()
604 err = bitmapUnmarshalled.UnmarshalBinary(bitmapBytes)
605 require.Nil(t, err)
606 assert.True(t, bitmap.Equals(bitmapUnmarshalled))
607 bitmapUnmarshalled = bitmapUnmarshalled.Clone()
608 assert.True(t, bitmap.Equals(bitmapUnmarshalled))
609}
610
611func TestBitmapFromBufferCOW(t *testing.T) {
612 rbbogus := NewBitmap()

Callers

nothing calls this directly

Calls 6

AddMethod · 0.95
MarshalBinaryMethod · 0.95
UnmarshalBinaryMethod · 0.95
EqualsMethod · 0.95
CloneMethod · 0.95
NewBitmapFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…