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

Function TestCreateAddr

net_test.go:31–40  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

29}
30
31func TestCreateAddr(t *testing.T) {
32 ipv4 := mustAddr(t, net.IP{127, 0, 0, 1})
33 ipv6 := mustAddr(t, net.IP{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1})
34 port := 9000
35
36 require.Equal(t, &net.UDPAddr{IP: ipv4.AsSlice(), Port: port}, createAddr(NetworkTypeUDP4, ipv4, port))
37 require.Equal(t, &net.UDPAddr{IP: ipv6.AsSlice(), Port: port}, createAddr(NetworkTypeUDP6, ipv6, port))
38 require.Equal(t, &net.TCPAddr{IP: ipv4.AsSlice(), Port: port}, createAddr(NetworkTypeTCP4, ipv4, port))
39 require.Equal(t, &net.TCPAddr{IP: ipv6.AsSlice(), Port: port}, createAddr(NetworkTypeTCP6, ipv6, port))
40}
41
42func problematicNetworkInterfaces(s string) (keep bool) {
43 defaultDockerBridgeNetwork := strings.Contains(s, "docker")

Callers

nothing calls this directly

Calls 3

mustAddrFunction · 0.85
createAddrFunction · 0.85
EqualMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…