mirror of
https://github.com/golang/go
synced 2024-11-12 05:40:22 -07:00
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: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
6de34e6e25
commit
d4ed8da996
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user