improve coverage

This commit is contained in:
aler9
2022-12-11 23:36:43 +01:00
parent 0c13440721
commit 46cbb885b7
22 changed files with 126 additions and 44 deletions

View File

@@ -3,6 +3,7 @@ package format
import (
"testing"
"github.com/pion/rtp"
"github.com/stretchr/testify/require"
)
@@ -25,6 +26,22 @@ func TestH264Attributes(t *testing.T) {
require.Equal(t, []byte{0x09, 0x0A}, format.SafePPS())
}
func TestH264PTSEqualsDTS(t *testing.T) {
format := &H264{
PayloadTyp: 96,
SPS: []byte{0x01, 0x02},
PPS: []byte{0x03, 0x04},
PacketizationMode: 1,
}
require.Equal(t, true, format.PTSEqualsDTS(&rtp.Packet{
Payload: []byte{0x05},
}))
require.Equal(t, false, format.PTSEqualsDTS(&rtp.Packet{
Payload: []byte{0x01},
}))
}
func TestH264Clone(t *testing.T) {
format := &H264{
PayloadTyp: 96,