improve coverage

This commit is contained in:
aler9
2021-07-04 12:45:31 +02:00
parent 7d06e872f2
commit 38658ec45f
2 changed files with 28 additions and 1 deletions

View File

@@ -287,6 +287,15 @@ func TestDecodeErrors(t *testing.T) {
pkts [][]byte
err string
}{
{
"invalid rtp",
[][]byte{
{
0xaa,
},
},
"RTP header size insufficient: 1 < 4",
},
{
"missing payload",
[][]byte{{
@@ -409,7 +418,7 @@ func TestReadSPSPPS(t *testing.T) {
pps []byte
}{
{
"standard",
"sps then pps",
[][]byte{
{128, 96, 61, 205, 54, 67, 90, 125, 40, 249, 97, 176, 7, 1, 2},
{128, 96, 61, 206, 54, 67, 90, 125, 40, 249, 97, 176, 8, 3, 4},
@@ -417,6 +426,15 @@ func TestReadSPSPPS(t *testing.T) {
[]byte{0x07, 0x01, 0x02},
[]byte{0x08, 0x03, 0x04},
},
{
"pps then sps",
[][]byte{
{128, 96, 61, 206, 54, 67, 90, 125, 40, 249, 97, 176, 8, 3, 4},
{128, 96, 61, 205, 54, 67, 90, 125, 40, 249, 97, 176, 7, 1, 2},
},
[]byte{0x07, 0x01, 0x02},
[]byte{0x08, 0x03, 0x04},
},
} {
t.Run(ca.name, func(t *testing.T) {
i := 0