git » go-net » commit 9bc2a33

internal/netreflect: fix test on nacl, plan9 and windows

author Mikio Hara
2016-08-30 03:17:57 UTC
committer Mikio Hara
2016-08-31 03:06:24 UTC
parent 6250b412798208e6c90b03b7c4f226de5aa299e2

internal/netreflect: fix test on nacl, plan9 and windows

Change-Id: Ia274e47affd5fc2b9bdea077fa8043887044d0ec
Reviewed-on: https://go-review.googlesource.com/28110
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>

internal/netreflect/socket_test.go +12 -11

diff --git a/internal/netreflect/socket_test.go b/internal/netreflect/socket_test.go
index cf814e2..305665a 100644
--- a/internal/netreflect/socket_test.go
+++ b/internal/netreflect/socket_test.go
@@ -62,15 +62,15 @@ func newLocalPacketListener(network string) (net.PacketConn, error) {
 
 func TestSocketOf(t *testing.T) {
 	for _, network := range []string{"tcp", "unix", "unixpacket"} {
-		switch network {
-		case "unix":
-			switch runtime.GOOS {
-			case "nacl", "plan9", "windows":
+		switch runtime.GOOS {
+		case "darwin":
+			if network == "unixpacket" {
 				continue
 			}
-		case "unixpacket":
-			switch runtime.GOOS {
-			case "darwin", "nacl", "plan9", "windows":
+		case "nacl", "plan9":
+			continue
+		case "windows":
+			if network == "unix" || network == "unixpacket" {
 				continue
 			}
 		}
@@ -101,10 +101,11 @@ func TestSocketOf(t *testing.T) {
 
 func TestPacketSocketOf(t *testing.T) {
 	for _, network := range []string{"udp", "unixgram"} {
-		switch network {
-		case "unixgram":
-			switch runtime.GOOS {
-			case "nacl", "plan9", "windows":
+		switch runtime.GOOS {
+		case "nacl", "plan9":
+			continue
+		case "windows":
+			if network == "unixgram" {
 				continue
 			}
 		}