mirror of
https://github.com/aler9/gortsplib
synced 2025-10-06 07:37:07 +08:00
improve coverage (#168)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package h264
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
@@ -63,23 +64,32 @@ func TestAVCCUnmarshalError(t *testing.T) {
|
||||
for _, ca := range []struct {
|
||||
name string
|
||||
enc []byte
|
||||
err string
|
||||
}{
|
||||
{
|
||||
"empty",
|
||||
[]byte{},
|
||||
"invalid length",
|
||||
},
|
||||
{
|
||||
"invalid length",
|
||||
[]byte{0x01},
|
||||
"invalid length",
|
||||
},
|
||||
{
|
||||
"invalid length",
|
||||
[]byte{0x00, 0x00, 0x00, 0x03},
|
||||
"invalid length",
|
||||
},
|
||||
{
|
||||
"too many nalus",
|
||||
bytes.Repeat([]byte{0x00, 0x00, 0x00, 0x01, 0x0a}, 21),
|
||||
"NALU count (21) exceeds maximum allowed (20)",
|
||||
},
|
||||
} {
|
||||
t.Run(ca.name, func(t *testing.T) {
|
||||
_, err := AVCCUnmarshal(ca.enc)
|
||||
require.Error(t, err)
|
||||
require.EqualError(t, err, ca.err)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user