mirror of
https://github.com/bjdgyc/anylink.git
synced 2025-08-09 03:41:29 +08:00
添加 github.com/pion/dtls 代码
This commit is contained in:
20
dtls-2.0.9/pkg/protocol/extension/use_srtp_test.go
Normal file
20
dtls-2.0.9/pkg/protocol/extension/use_srtp_test.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package extension
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestExtensionUseSRTP(t *testing.T) {
|
||||
rawUseSRTP := []byte{0x00, 0x0e, 0x00, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00}
|
||||
parsedUseSRTP := &UseSRTP{
|
||||
ProtectionProfiles: []SRTPProtectionProfile{SRTP_AES128_CM_HMAC_SHA1_80},
|
||||
}
|
||||
|
||||
raw, err := parsedUseSRTP.Marshal()
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
} else if !reflect.DeepEqual(raw, rawUseSRTP) {
|
||||
t.Errorf("extensionUseSRTP marshal: got %#v, want %#v", raw, rawUseSRTP)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user