improve coverage (#168)

This commit is contained in:
Alessandro Ros
2023-01-06 23:34:10 +01:00
committed by GitHub
parent a759ba9d01
commit 2e88705875
195 changed files with 535 additions and 63 deletions

View File

@@ -56,3 +56,26 @@ func TestDTSExtractor(t *testing.T) {
})
}
}
func FuzzDTSExtractor(f *testing.F) {
sps := []byte{
0x42, 0x01, 0x01, 0x01, 0x60, 0x00, 0x00, 0x03,
0x00, 0x90, 0x00, 0x00, 0x03, 0x00, 0x00, 0x03,
0x00, 0x78, 0xa0, 0x03, 0xc0, 0x80, 0x10, 0xe5,
0x96, 0x66, 0x69, 0x24, 0xca, 0xe0, 0x10, 0x00,
0x00, 0x03, 0x00, 0x10, 0x00, 0x00, 0x03, 0x01,
0xe0, 0x80,
}
pps := []byte{
0x44, 0x01, 0xc1, 0x72, 0xb4, 0x62, 0x40,
}
ex := NewDTSExtractor()
f.Fuzz(func(t *testing.T, b []byte, p uint64) {
if len(b) < 1 {
return
}
ex.Extract([][]byte{sps, pps, b}, time.Duration(p))
})
}