Added a test for slice bounds out of range

This commit is contained in:
Ashley Svetlik 2019-06-13 11:54:52 -05:00
parent 4039583ccd
commit a1f6321b1d

23
roaring/fuzz_test.go Normal file
View file

@ -0,0 +1,23 @@
package roaring
import (
"testing"
)
func TestUnmarshalBinary(t *testing.T) {
b := NewBitmap()
confirmedCrashers := []struct {
cr []byte
} {
{cr : []byte(":000000")},
{cr : []byte("<000000000000000")},
}
for _, crash := range confirmedCrashers {
err := b.UnmarshalBinary(crash.cr)
if err != nil {
t.Error("Known crasher failed.")
}
}
}