Commit 8b6dafa8 authored by David Crawshaw's avatar David Crawshaw

net: treat android like linux in tests

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/112810043
parent a31eeef7
...@@ -38,7 +38,7 @@ func TestConnAndListener(t *testing.T) { ...@@ -38,7 +38,7 @@ func TestConnAndListener(t *testing.T) {
} }
case "unixpacket": case "unixpacket":
switch runtime.GOOS { switch runtime.GOOS {
case "darwin", "nacl", "openbsd", "plan9", "windows": case "android", "darwin", "nacl", "openbsd", "plan9", "windows":
continue continue
case "freebsd": // FreeBSD 8 doesn't support unixpacket case "freebsd": // FreeBSD 8 doesn't support unixpacket
continue continue
......
...@@ -25,7 +25,7 @@ var ipv4MulticastListenerTests = []struct { ...@@ -25,7 +25,7 @@ var ipv4MulticastListenerTests = []struct {
// port. // port.
func TestIPv4MulticastListener(t *testing.T) { func TestIPv4MulticastListener(t *testing.T) {
switch runtime.GOOS { switch runtime.GOOS {
case "nacl", "plan9": case "android", "nacl", "plan9":
t.Skipf("skipping test on %q", runtime.GOOS) t.Skipf("skipping test on %q", runtime.GOOS)
case "solaris": case "solaris":
t.Skipf("skipping test on solaris, see issue 7399") t.Skipf("skipping test on solaris, see issue 7399")
......
...@@ -12,9 +12,9 @@ import ( ...@@ -12,9 +12,9 @@ import (
) )
func TestReadLine(t *testing.T) { func TestReadLine(t *testing.T) {
// /etc/services file does not exist on windows and Plan 9. // /etc/services file does not exist on android, plan9, windows.
switch runtime.GOOS { switch runtime.GOOS {
case "plan9", "windows": case "android", "plan9", "windows":
t.Skipf("skipping test on %q", runtime.GOOS) t.Skipf("skipping test on %q", runtime.GOOS)
} }
filename := "/etc/services" // a nice big file filename := "/etc/services" // a nice big file
......
...@@ -256,9 +256,12 @@ func TestUnixConnLocalAndRemoteNames(t *testing.T) { ...@@ -256,9 +256,12 @@ func TestUnixConnLocalAndRemoteNames(t *testing.T) {
t.Fatalf("UnixConn.Write failed: %v", err) t.Fatalf("UnixConn.Write failed: %v", err)
} }
if runtime.GOOS == "linux" && laddr == "" { switch runtime.GOOS {
case "android", "linux":
if laddr == "" {
laddr = "@" // autobind feature laddr = "@" // autobind feature
} }
}
var connAddrs = [3]struct{ got, want Addr }{ var connAddrs = [3]struct{ got, want Addr }{
{ln.Addr(), ta}, {ln.Addr(), ta},
{c.LocalAddr(), &UnixAddr{Name: laddr, Net: "unix"}}, {c.LocalAddr(), &UnixAddr{Name: laddr, Net: "unix"}},
...@@ -308,9 +311,13 @@ func TestUnixgramConnLocalAndRemoteNames(t *testing.T) { ...@@ -308,9 +311,13 @@ func TestUnixgramConnLocalAndRemoteNames(t *testing.T) {
} }
}() }()
if runtime.GOOS == "linux" && laddr == "" { switch runtime.GOOS {
case "android", "linux":
if laddr == "" {
laddr = "@" // autobind feature laddr = "@" // autobind feature
} }
}
var connAddrs = [4]struct{ got, want Addr }{ var connAddrs = [4]struct{ got, want Addr }{
{c1.LocalAddr(), ta}, {c1.LocalAddr(), ta},
{c1.RemoteAddr(), nil}, {c1.RemoteAddr(), 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