mirror of
https://github.com/pion/ice.git
synced 2025-10-29 18:01:52 +08:00
Update CI configs to v0.4.7
Update lint scripts and CI configs.
This commit is contained in:
@@ -2,32 +2,41 @@ package ice
|
||||
|
||||
import "testing"
|
||||
|
||||
var (
|
||||
hostCandidate = &CandidateHost{
|
||||
func hostCandidate() *CandidateHost {
|
||||
return &CandidateHost{
|
||||
candidateBase: candidateBase{
|
||||
candidateType: CandidateTypeHost,
|
||||
component: ComponentRTP,
|
||||
},
|
||||
}
|
||||
prflxCandidate = &CandidatePeerReflexive{
|
||||
}
|
||||
|
||||
func prflxCandidate() *CandidatePeerReflexive {
|
||||
return &CandidatePeerReflexive{
|
||||
candidateBase: candidateBase{
|
||||
candidateType: CandidateTypePeerReflexive,
|
||||
component: ComponentRTP,
|
||||
},
|
||||
}
|
||||
srflxCandidate = &CandidateServerReflexive{
|
||||
}
|
||||
|
||||
func srflxCandidate() *CandidateServerReflexive {
|
||||
return &CandidateServerReflexive{
|
||||
candidateBase: candidateBase{
|
||||
candidateType: CandidateTypeServerReflexive,
|
||||
component: ComponentRTP,
|
||||
},
|
||||
}
|
||||
relayCandidate = &CandidateRelay{
|
||||
}
|
||||
|
||||
func relayCandidate() *CandidateRelay {
|
||||
return &CandidateRelay{
|
||||
candidateBase: candidateBase{
|
||||
candidateType: CandidateTypeRelay,
|
||||
component: ComponentRTP,
|
||||
},
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
func TestCandidatePairPriority(t *testing.T) {
|
||||
for _, test := range []struct {
|
||||
@@ -36,64 +45,64 @@ func TestCandidatePairPriority(t *testing.T) {
|
||||
}{
|
||||
{
|
||||
Pair: newCandidatePair(
|
||||
hostCandidate,
|
||||
hostCandidate,
|
||||
hostCandidate(),
|
||||
hostCandidate(),
|
||||
false,
|
||||
),
|
||||
WantPriority: 9151314440652587007,
|
||||
},
|
||||
{
|
||||
Pair: newCandidatePair(
|
||||
hostCandidate,
|
||||
hostCandidate,
|
||||
hostCandidate(),
|
||||
hostCandidate(),
|
||||
true,
|
||||
),
|
||||
WantPriority: 9151314440652587007,
|
||||
},
|
||||
{
|
||||
Pair: newCandidatePair(
|
||||
hostCandidate,
|
||||
prflxCandidate,
|
||||
hostCandidate(),
|
||||
prflxCandidate(),
|
||||
true,
|
||||
),
|
||||
WantPriority: 7998392936314175488,
|
||||
},
|
||||
{
|
||||
Pair: newCandidatePair(
|
||||
hostCandidate,
|
||||
prflxCandidate,
|
||||
hostCandidate(),
|
||||
prflxCandidate(),
|
||||
false,
|
||||
),
|
||||
WantPriority: 7998392936314175487,
|
||||
},
|
||||
{
|
||||
Pair: newCandidatePair(
|
||||
hostCandidate,
|
||||
srflxCandidate,
|
||||
hostCandidate(),
|
||||
srflxCandidate(),
|
||||
true,
|
||||
),
|
||||
WantPriority: 7277816996102668288,
|
||||
},
|
||||
{
|
||||
Pair: newCandidatePair(
|
||||
hostCandidate,
|
||||
srflxCandidate,
|
||||
hostCandidate(),
|
||||
srflxCandidate(),
|
||||
false,
|
||||
),
|
||||
WantPriority: 7277816996102668287,
|
||||
},
|
||||
{
|
||||
Pair: newCandidatePair(
|
||||
hostCandidate,
|
||||
relayCandidate,
|
||||
hostCandidate(),
|
||||
relayCandidate(),
|
||||
true,
|
||||
),
|
||||
WantPriority: 72057593987596288,
|
||||
},
|
||||
{
|
||||
Pair: newCandidatePair(
|
||||
hostCandidate,
|
||||
relayCandidate,
|
||||
hostCandidate(),
|
||||
relayCandidate(),
|
||||
false,
|
||||
),
|
||||
WantPriority: 72057593987596287,
|
||||
@@ -106,8 +115,8 @@ func TestCandidatePairPriority(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestCandidatePairEquality(t *testing.T) {
|
||||
pairA := newCandidatePair(hostCandidate, srflxCandidate, true)
|
||||
pairB := newCandidatePair(hostCandidate, srflxCandidate, false)
|
||||
pairA := newCandidatePair(hostCandidate(), srflxCandidate(), true)
|
||||
pairB := newCandidatePair(hostCandidate(), srflxCandidate(), false)
|
||||
|
||||
if !pairA.Equal(pairB) {
|
||||
t.Fatalf("Expected %v to equal %v", pairA, pairB)
|
||||
|
||||
Reference in New Issue
Block a user