Commit 60c41d1d authored by Mikio Hara's avatar Mikio Hara Committed by Matt Layher

internal/netreflect: more use of internal/nettest package

Change-Id: I4473e69bbb445ab27554f2dc625d0cbd79d7cfe5
Reviewed-on: https://go-review.googlesource.com/35072
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: 's avatarMatt Layher <mdlayher@gmail.com>
parent db8e2419
...@@ -7,7 +7,6 @@ package netreflect_test ...@@ -7,7 +7,6 @@ package netreflect_test
import ( import (
"net" "net"
"os" "os"
"runtime"
"testing" "testing"
"golang.org/x/net/internal/netreflect" "golang.org/x/net/internal/netreflect"
...@@ -16,17 +15,8 @@ import ( ...@@ -16,17 +15,8 @@ import (
func TestSocketOf(t *testing.T) { func TestSocketOf(t *testing.T) {
for _, network := range []string{"tcp", "unix", "unixpacket"} { for _, network := range []string{"tcp", "unix", "unixpacket"} {
switch runtime.GOOS { if !nettest.TestableNetwork(network) {
case "darwin":
if network == "unixpacket" {
continue
}
case "nacl", "plan9":
continue continue
case "windows":
if network == "unix" || network == "unixpacket" {
continue
}
} }
ln, err := nettest.NewLocalListener(network) ln, err := nettest.NewLocalListener(network)
if err != nil { if err != nil {
...@@ -55,13 +45,8 @@ func TestSocketOf(t *testing.T) { ...@@ -55,13 +45,8 @@ func TestSocketOf(t *testing.T) {
func TestPacketSocketOf(t *testing.T) { func TestPacketSocketOf(t *testing.T) {
for _, network := range []string{"udp", "unixgram"} { for _, network := range []string{"udp", "unixgram"} {
switch runtime.GOOS { if !nettest.TestableNetwork(network) {
case "nacl", "plan9":
continue continue
case "windows":
if network == "unixgram" {
continue
}
} }
c, err := nettest.NewLocalPacketListener(network) c, err := nettest.NewLocalPacketListener(network)
if err != nil { if err != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment