MCPcopy Create free account
hub / github.com/pion/rtp / TestRFC8285OneByteSetExtensionShouldErrorWhenPayloadTooLarge

Function TestRFC8285OneByteSetExtensionShouldErrorWhenPayloadTooLarge

packet_test.go:809–840  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

807}
808
809func TestRFC8285OneByteSetExtensionShouldErrorWhenPayloadTooLarge(t *testing.T) {
810 payload := []byte{
811 // Payload
812 0x98, 0x36, 0xbe, 0x88, 0x9e,
813 }
814 p := &Packet{
815 Header: Header{
816 Marker: true,
817 Extension: true,
818 ExtensionProfile: 0xBEDE,
819 Extensions: []Extension{
820 {1, []byte{
821 0xAA,
822 }},
823 },
824 Version: 2,
825 PayloadType: 96,
826 SequenceNumber: 27023,
827 Timestamp: 3653407706,
828 SSRC: 476325762,
829 CSRC: []uint32{},
830 },
831 Payload: payload,
832 }
833
834 if p.SetExtension(1, []byte{
835 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB,
836 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB,
837 }) == nil {
838 t.Error("SetExtension did not error on too large payload")
839 }
840}
841
842func TestRFC8285TwoByteSetExtensionShouldEnableExensionsWhenAdding(t *testing.T) {
843 payload := []byte{

Callers

nothing calls this directly

Calls 1

SetExtensionMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…