mirror of
https://github.com/aler9/gortsplib
synced 2025-10-05 23:26:54 +08:00
rewrite fuzz tests of decoders in order to get deterministic results (#261)
This commit is contained in:
@@ -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,
|
||||
|
Reference in New Issue
Block a user