mirror of
https://github.com/netbirdio/ice.git
synced 2026-05-22 17:10:58 -07:00
Add test for setting nil candidatepair
This was already fixed in c2e6f9, but adding a test to ensure we don't regress Resolves #303
This commit is contained in:
@@ -1694,3 +1694,11 @@ func TestNilCandidate(t *testing.T) {
|
||||
assert.NoError(t, a.AddRemoteCandidate(nil))
|
||||
assert.NoError(t, a.Close())
|
||||
}
|
||||
|
||||
func TestNilCandidatePair(t *testing.T) {
|
||||
a, err := NewAgent(&AgentConfig{})
|
||||
assert.NoError(t, err)
|
||||
|
||||
a.setSelectedPair(nil)
|
||||
assert.NoError(t, a.Close())
|
||||
}
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
package ice
|
||||
|
||||
import "testing"
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func hostCandidate() *CandidateHost {
|
||||
return &CandidateHost{
|
||||
@@ -125,8 +129,5 @@ func TestCandidatePairEquality(t *testing.T) {
|
||||
|
||||
func TestNilCandidatePairString(t *testing.T) {
|
||||
var nilCandidatePair *candidatePair
|
||||
|
||||
if res := nilCandidatePair.String(); res != "" {
|
||||
t.Fatalf("Expected %v to equal %v", res, "")
|
||||
}
|
||||
assert.Equal(t, nilCandidatePair.String(), "")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user