mirror of
https://github.com/bjdgyc/anylink.git
synced 2025-08-09 01:40:31 +08:00
添加 github.com/pion/dtls 代码
This commit is contained in:
22
dtls-2.0.9/pkg/protocol/extension/renegotiation_info_test.go
Normal file
22
dtls-2.0.9/pkg/protocol/extension/renegotiation_info_test.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package extension
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestRenegotiationInfo(t *testing.T) {
|
||||
extension := RenegotiationInfo{RenegotiatedConnection: 0}
|
||||
|
||||
raw, err := extension.Marshal()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
newExtension := RenegotiationInfo{}
|
||||
err = newExtension.Unmarshal(raw)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if newExtension.RenegotiatedConnection != extension.RenegotiatedConnection {
|
||||
t.Errorf("extensionRenegotiationInfo marshal: got %d expected %d", newExtension.RenegotiatedConnection, extension.RenegotiatedConnection)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user