improve fuzz tests (#571)

This commit is contained in:
Alessandro Ros
2024-05-17 19:19:15 +02:00
committed by GitHub
parent f283abc2e7
commit ef60c8c755
20 changed files with 250 additions and 234 deletions

View File

@@ -182,12 +182,9 @@ func TestRequestString(t *testing.T) {
}
func FuzzRequestUnmarshal(f *testing.F) {
f.Add([]byte("GET rtsp://testing123/test"))
f.Add([]byte("GET rtsp://testing123/test RTSP/1.0\r\n"))
f.Add([]byte("OPTIONS rtsp://example.com/media.mp4 RTSP/1.0\r\n" +
"Content-Length: 100\r\n" +
"\r\n" +
"testing"))
for _, ca := range casesRequest {
f.Add(ca.byts)
}
f.Fuzz(func(_ *testing.T, b []byte) {
var req Request