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

Function TestSerializationFromJavaWithRuns052

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

Source from the content-addressed store, hash-verified

187}
188
189func TestSerializationFromJavaWithRuns052(t *testing.T) {
190 fname := "testdata/bitmapwithruns.bin"
191
192 newrb := NewBitmap()
193 fin, err := os.Open(fname)
194 if err != nil {
195 fmt.Fprintf(os.Stderr, "\n\nIMPORTANT: For testing file IO, the roaring library requires disk access.\nWe omit some tests for now.\n\n")
196 return
197 }
198
199 defer func() {
200 fin.Close()
201 }()
202 _, _ = newrb.ReadFrom(fin)
203 rb := NewBitmap()
204
205 for k := uint32(0); k < 100000; k += 1000 {
206 rb.Add(k)
207 }
208 for k := uint32(100000); k < 200000; k++ {
209 rb.Add(3 * k)
210 }
211 for k := uint32(700000); k < 800000; k++ {
212 rb.Add(k)
213 }
214
215 assert.True(t, rb.Equals(newrb))
216}
217
218func TestSerializationBasic2_041(t *testing.T) {
219 rb := BitmapOf(1, 2, 3, 4, 5, 100, 1000, 10000, 100000, 1000000)

Callers

nothing calls this directly

Calls 4

ReadFromMethod · 0.95
AddMethod · 0.95
EqualsMethod · 0.95
NewBitmapFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…