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

Function TestSerializationOfEmptyBitmap

roaring64/serialization_test.go:31–50  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

29}
30
31func TestSerializationOfEmptyBitmap(t *testing.T) {
32 rb := NewBitmap()
33
34 buf := &bytes.Buffer{}
35 _, err := rb.WriteTo(buf)
36
37 require.NoError(t, err)
38 assert.EqualValues(t, buf.Len(), rb.GetSerializedSizeInBytes())
39 data := buf.Bytes()
40
41 newrb := NewBitmap()
42 _, err = newrb.ReadFrom(buf)
43
44 require.NoError(t, err)
45 assert.True(t, rb.Equals(newrb))
46
47 newrb2 := NewBitmap()
48 fromUnsafeBytesChecked(t, newrb2, data)
49 assert.True(t, rb.Equals(newrb2))
50}
51
52func TestBase64_036(t *testing.T) {
53 rb := BitmapOf(1, 2, 3, 4, 5, 100, 1000)

Callers

nothing calls this directly

Calls 7

WriteToMethod · 0.95
ReadFromMethod · 0.95
EqualsMethod · 0.95
fromUnsafeBytesCheckedFunction · 0.85
NewBitmapFunction · 0.70
LenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…