mirror of
https://github.com/pion/webrtc.git
synced 2025-11-03 09:40:59 +08:00
Add SetDTLSEllipticCurves test
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/pion/dtls/v2/pkg/crypto/elliptic"
|
||||
"github.com/pion/transport/v2/test"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
@@ -234,6 +235,20 @@ func TestSetDTLSRetransmissionInterval(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestSetDTLSEllipticCurves(t *testing.T) {
|
||||
s := SettingEngine{}
|
||||
|
||||
if len(s.dtls.ellipticCurves) != 0 {
|
||||
t.Fatalf("SettingEngine defaults aren't as expected.")
|
||||
}
|
||||
|
||||
s.SetDTLSEllipticCurves(elliptic.P256)
|
||||
if len(s.dtls.ellipticCurves) == 0 ||
|
||||
s.dtls.ellipticCurves[0] != elliptic.P256 {
|
||||
t.Errorf("Failed to set DTLS elliptic curves")
|
||||
}
|
||||
}
|
||||
|
||||
func TestSetSCTPMaxReceiverBufferSize(t *testing.T) {
|
||||
s := SettingEngine{}
|
||||
assert.Equal(t, uint32(0), s.sctp.maxReceiveBufferSize)
|
||||
|
||||
Reference in New Issue
Block a user