github.com/pion/dtls/v2@v2.2.12/pkg/protocol/extension/use_srtp_test.go (about) 1 // SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly> 2 // SPDX-License-Identifier: MIT 3 4 package extension 5 6 import ( 7 "reflect" 8 "testing" 9 ) 10 11 func TestExtensionUseSRTP(t *testing.T) { 12 rawUseSRTP := []byte{0x00, 0x0e, 0x00, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00} 13 parsedUseSRTP := &UseSRTP{ 14 ProtectionProfiles: []SRTPProtectionProfile{SRTP_AES128_CM_HMAC_SHA1_80}, 15 } 16 17 raw, err := parsedUseSRTP.Marshal() 18 if err != nil { 19 t.Error(err) 20 } else if !reflect.DeepEqual(raw, rawUseSRTP) { 21 t.Errorf("extensionUseSRTP marshal: got %#v, want %#v", raw, rawUseSRTP) 22 } 23 }