MCPcopy Create free account
hub / github.com/pion/ice / assertExternalIPStrings

Function assertExternalIPStrings

external_ip_mapper_test.go:28–45  ·  view source on GitHub ↗
(
	t *testing.T,
	mapper *addressRewriteMapper,
	candidateType CandidateType,
	localIP string,
	iface string,
	expected ...string,
)

Source from the content-addressed store, hash-verified

26}
27
28func assertExternalIPStrings(
29 t *testing.T,
30 mapper *addressRewriteMapper,
31 candidateType CandidateType,
32 localIP string,
33 iface string,
34 expected ...string,
35) {
36 t.Helper()
37
38 ips, matched, _, err := mapper.findExternalIPs(candidateType, localIP, iface)
39 assert.NoError(t, err)
40 assert.True(t, matched)
41 assert.Len(t, ips, len(expected))
42 for i, ip := range ips {
43 assert.Equal(t, expected[i], ip.String())
44 }
45}
46
47func assertNoExternalMapping(t *testing.T, mapper *addressRewriteMapper, candidateType CandidateType, localIP string) {
48 t.Helper()

Calls 3

EqualMethod · 0.65
StringMethod · 0.65
findExternalIPsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…