Commit d4ed8da9 authored by Mikio Hara's avatar Mikio Hara

net: don't increase test table rows when using -test.count flag

Change-Id: I7881e3353dc5cd9755a79ea0eab146c6a0a08306
Reviewed-on: https://go-review.googlesource.com/23195
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 6de34e6e
......@@ -591,13 +591,17 @@ func TestDialerPartialDeadline(t *testing.T) {
}
}
type dialerLocalAddrTest struct {
func TestDialerLocalAddr(t *testing.T) {
if !supportsIPv4 || !supportsIPv6 {
t.Skip("both IPv4 and IPv6 are required")
}
type test struct {
network, raddr string
laddr Addr
error
}
var dialerLocalAddrTests = []dialerLocalAddrTest{
}
var tests = []test{
{"tcp4", "127.0.0.1", nil, nil},
{"tcp4", "127.0.0.1", &TCPAddr{}, nil},
{"tcp4", "127.0.0.1", &TCPAddr{IP: ParseIP("0.0.0.0")}, nil},
......@@ -640,19 +644,14 @@ var dialerLocalAddrTests = []dialerLocalAddrTest{
{"tcp", "::1", &TCPAddr{IP: IPv6loopback}, nil},
{"tcp", "::1", &UDPAddr{}, &AddrError{Err: "some error"}},
{"tcp", "::1", &UnixAddr{}, &AddrError{Err: "some error"}},
}
func TestDialerLocalAddr(t *testing.T) {
if !supportsIPv4 || !supportsIPv6 {
t.Skip("both IPv4 and IPv6 are required")
}
if supportsIPv4map {
dialerLocalAddrTests = append(dialerLocalAddrTests, dialerLocalAddrTest{
tests = append(tests, test{
"tcp", "127.0.0.1", &TCPAddr{IP: ParseIP("::")}, nil,
})
} else {
dialerLocalAddrTests = append(dialerLocalAddrTests, dialerLocalAddrTest{
tests = append(tests, test{
"tcp", "127.0.0.1", &TCPAddr{IP: ParseIP("::")}, &AddrError{Err: "some error"},
})
}
......@@ -682,7 +681,7 @@ func TestDialerLocalAddr(t *testing.T) {
}
}
for _, tt := range dialerLocalAddrTests {
for _, tt := range tests {
d := &Dialer{LocalAddr: tt.laddr}
var addr string
ip := ParseIP(tt.raddr)
......
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