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

Function TestRFC8285OneByteSetExtensionShouldEnableExensionsWhenAdding

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

Source from the content-addressed store, hash-verified

633}
634
635func TestRFC8285OneByteSetExtensionShouldEnableExensionsWhenAdding(t *testing.T) {
636 payload := []byte{
637 // Payload
638 0x98, 0x36, 0xbe, 0x88, 0x9e,
639 }
640 p := &Packet{
641 Header: Header{
642 Marker: true,
643 Extension: false,
644 Version: 2,
645 PayloadType: 96,
646 SequenceNumber: 27023,
647 Timestamp: 3653407706,
648 SSRC: 476325762,
649 CSRC: []uint32{},
650 },
651 Payload: payload,
652 }
653
654 extension := []byte{0xAA, 0xAA}
655 err := p.SetExtension(1, extension)
656 if err != nil {
657 t.Error("Error setting extension")
658 }
659
660 if p.Extension != true {
661 t.Error("Extension should be set to true")
662 }
663
664 if p.ExtensionProfile != 0xBEDE {
665 t.Error("Extension profile should be set to 0xBEDE")
666 }
667
668 if len(p.Extensions) != 1 {
669 t.Error("Extensions should be set to 1")
670 }
671
672 if !bytes.Equal(p.GetExtension(1), extension) {
673 t.Error("Extension value is not set")
674 }
675}
676
677func TestRFC8285OneByteSetExtensionShouldSetCorrectExtensionProfileFor16ByteExtension(t *testing.T) {
678 payload := []byte{

Callers

nothing calls this directly

Calls 2

SetExtensionMethod · 0.80
GetExtensionMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…