Add SetDTLSEllipticCurves test

This commit is contained in:
Anton
2023-02-24 12:47:09 +05:00
committed by Sean DuBois
parent 9671875982
commit 1e5378a52c

View File

@@ -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)