rewrite fuzz tests of decoders in order to get deterministic results (#261)

This commit is contained in:
Alessandro Ros
2023-04-26 12:30:51 +02:00
committed by GitHub
parent d6a55f882a
commit d56ae1f600
63 changed files with 192 additions and 99 deletions

View File

@@ -70,15 +70,15 @@ func TestDecodeADTS(t *testing.T) {
}
func FuzzDecoder(f *testing.F) {
d := &Decoder{
SampleRate: 16000,
SizeLength: 13,
IndexLength: 3,
IndexDeltaLength: 3,
}
d.Init()
f.Fuzz(func(t *testing.T, a []byte, am bool, b []byte, bm bool) {
d := &Decoder{
SampleRate: 16000,
SizeLength: 13,
IndexLength: 3,
IndexDeltaLength: 3,
}
d.Init()
d.Decode(&rtp.Packet{
Header: rtp.Header{
Version: 2,