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

@@ -36,10 +36,22 @@ func TestDecode(t *testing.T) {
}
func FuzzDecoder(f *testing.F) {
d := &Decoder{}
d.Init()
f.Fuzz(func(t *testing.T, a []byte, b []byte) {
d := &Decoder{}
d.Init()
d.Decode(&rtp.Packet{
Header: rtp.Header{
Version: 2,
Marker: false,
PayloadType: 96,
SequenceNumber: 17645,
Timestamp: 2289527317,
SSRC: 0x9dbb7812,
},
Payload: a,
})
f.Fuzz(func(t *testing.T, b []byte) {
d.Decode(&rtp.Packet{
Header: rtp.Header{
Version: 2,