diff options
author | Michael Stapelberg <stapelberg@debian.org> | 2013-05-14 18:39:35 +0200 |
---|---|---|
committer | Michael Stapelberg <michael@stapelberg.de> | 2013-05-14 18:39:35 +0200 |
commit | efcc50dfdc94c82ee0292bf71992ecb7c0123061 (patch) | |
tree | 17dca99d1dc7fc4e9fe49c2cf6a99d337d4c039f /src/pkg/net/unicast_posix_test.go | |
parent | 04b08da9af0c450d645ab7389d1467308cfc2db8 (diff) | |
download | golang-efcc50dfdc94c82ee0292bf71992ecb7c0123061.tar.gz |
Imported Upstream version 1.1upstream/1.1
Diffstat (limited to 'src/pkg/net/unicast_posix_test.go')
-rw-r--r-- | src/pkg/net/unicast_posix_test.go | 65 |
1 files changed, 4 insertions, 61 deletions
diff --git a/src/pkg/net/unicast_posix_test.go b/src/pkg/net/unicast_posix_test.go index a8855cab7..b0588f4e5 100644 --- a/src/pkg/net/unicast_posix_test.go +++ b/src/pkg/net/unicast_posix_test.go @@ -45,7 +45,7 @@ var listenerTests = []struct { // same port. func TestTCPListener(t *testing.T) { switch runtime.GOOS { - case "plan9", "windows": + case "plan9": t.Skipf("skipping test on %q", runtime.GOOS) } @@ -69,65 +69,8 @@ func TestTCPListener(t *testing.T) { // same port. func TestUDPListener(t *testing.T) { switch runtime.GOOS { - case "plan9", "windows": - t.Skipf("skipping test on %q", runtime.GOOS) - } - - toudpnet := func(net string) string { - switch net { - case "tcp": - return "udp" - case "tcp4": - return "udp4" - case "tcp6": - return "udp6" - } - return "<nil>" - } - - for _, tt := range listenerTests { - if tt.wildcard && (testing.Short() || !*testExternal) { - continue - } - if tt.ipv6 && !supportsIPv6 { - continue - } - tt.net = toudpnet(tt.net) - l1, port := usableListenPacketPort(t, tt.net, tt.laddr) - checkFirstListener(t, tt.net, tt.laddr+":"+port, l1) - l2, err := ListenPacket(tt.net, tt.laddr+":"+port) - checkSecondListener(t, tt.net, tt.laddr+":"+port, err, l2) - l1.Close() - } -} - -func TestSimpleTCPListener(t *testing.T) { - switch runtime.GOOS { - case "plan9": - t.Skipf("skipping test on %q", runtime.GOOS) - return - } - - for _, tt := range listenerTests { - if tt.wildcard && (testing.Short() || !*testExternal) { - continue - } - if tt.ipv6 { - continue - } - l1, port := usableListenPort(t, tt.net, tt.laddr) - checkFirstListener(t, tt.net, tt.laddr+":"+port, l1) - l2, err := Listen(tt.net, tt.laddr+":"+port) - checkSecondListener(t, tt.net, tt.laddr+":"+port, err, l2) - l1.Close() - } -} - -func TestSimpleUDPListener(t *testing.T) { - switch runtime.GOOS { case "plan9": t.Skipf("skipping test on %q", runtime.GOOS) - return } toudpnet := func(net string) string { @@ -146,7 +89,7 @@ func TestSimpleUDPListener(t *testing.T) { if tt.wildcard && (testing.Short() || !*testExternal) { continue } - if tt.ipv6 { + if tt.ipv6 && !supportsIPv6 { continue } tt.net = toudpnet(tt.net) @@ -231,7 +174,7 @@ func TestDualStackTCPListener(t *testing.T) { t.Skipf("skipping test on %q", runtime.GOOS) } if !supportsIPv6 { - return + t.Skip("ipv6 is not supported") } for _, tt := range dualStackListenerTests { @@ -263,7 +206,7 @@ func TestDualStackUDPListener(t *testing.T) { t.Skipf("skipping test on %q", runtime.GOOS) } if !supportsIPv6 { - return + t.Skip("ipv6 is not supported") } toudpnet := func(net string) string { |