summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/RoaringBitmap/roaring/serializationfuzz.go
blob: 5eaa22202cf42b89dbeb16f373d97feb1ba1cba6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// +build gofuzz

package roaring

import "bytes"

func FuzzSerializationStream(data []byte) int {
	newrb := NewBitmap()
	if _, err := newrb.ReadFrom(bytes.NewReader(data)); err != nil {
		return 0
	}
	return 1
}

func FuzzSerializationBuffer(data []byte) int {
	newrb := NewBitmap()
	if _, err := newrb.FromBuffer(data); err != nil {
		return 0
	}
	return 1
}