Ver Fonte

ipv4: remove unnecessary double quotations from test messages

Change-Id: If1243dd2d79824933d896a8c4b31db8c247d0c21
Reviewed-on: https://go-review.googlesource.com/3561
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Mikio Hara há 11 anos atrás
pai
commit
200fa7c741

+ 2 - 2
ipv4/icmp_test.go

@@ -36,7 +36,7 @@ func TestICMPFilter(t *testing.T) {
 	switch runtime.GOOS {
 	case "linux":
 	default:
-		t.Skipf("not supported on %q", runtime.GOOS)
+		t.Skipf("not supported on %s", runtime.GOOS)
 	}
 
 	var f ipv4.ICMPFilter
@@ -64,7 +64,7 @@ func TestSetICMPFilter(t *testing.T) {
 	switch runtime.GOOS {
 	case "linux":
 	default:
-		t.Skipf("not supported on %q", runtime.GOOS)
+		t.Skipf("not supported on %s", runtime.GOOS)
 	}
 	if m, ok := nettest.SupportsRawIPSocket(); !ok {
 		t.Skip(m)

+ 11 - 11
ipv4/multicast_test.go

@@ -30,11 +30,11 @@ var packetConnReadWriteMulticastUDPTests = []struct {
 func TestPacketConnReadWriteMulticastUDP(t *testing.T) {
 	switch runtime.GOOS {
 	case "nacl", "plan9", "solaris", "windows":
-		t.Skipf("not supported on %q", runtime.GOOS)
+		t.Skipf("not supported on %s", runtime.GOOS)
 	}
 	ifi := nettest.RoutedInterface("ip4", net.FlagUp|net.FlagMulticast|net.FlagLoopback)
 	if ifi == nil {
-		t.Skipf("not available on %q", runtime.GOOS)
+		t.Skipf("not available on %s", runtime.GOOS)
 	}
 
 	for _, tt := range packetConnReadWriteMulticastUDPTests {
@@ -58,7 +58,7 @@ func TestPacketConnReadWriteMulticastUDP(t *testing.T) {
 				switch runtime.GOOS {
 				case "freebsd", "linux":
 				default: // platforms that don't support IGMPv2/3 fail here
-					t.Logf("not supported on %q", runtime.GOOS)
+					t.Logf("not supported on %s", runtime.GOOS)
 					continue
 				}
 				t.Fatal(err)
@@ -83,7 +83,7 @@ func TestPacketConnReadWriteMulticastUDP(t *testing.T) {
 		for i, toggle := range []bool{true, false, true} {
 			if err := p.SetControlMessage(cf, toggle); err != nil {
 				if nettest.ProtocolNotSupported(err) {
-					t.Logf("not supported on %q", runtime.GOOS)
+					t.Logf("not supported on %s", runtime.GOOS)
 					continue
 				}
 				t.Fatal(err)
@@ -120,14 +120,14 @@ var packetConnReadWriteMulticastICMPTests = []struct {
 func TestPacketConnReadWriteMulticastICMP(t *testing.T) {
 	switch runtime.GOOS {
 	case "nacl", "plan9", "solaris", "windows":
-		t.Skipf("not supported on %q", runtime.GOOS)
+		t.Skipf("not supported on %s", runtime.GOOS)
 	}
 	if m, ok := nettest.SupportsRawIPSocket(); !ok {
 		t.Skip(m)
 	}
 	ifi := nettest.RoutedInterface("ip4", net.FlagUp|net.FlagMulticast|net.FlagLoopback)
 	if ifi == nil {
-		t.Skipf("not available on %q", runtime.GOOS)
+		t.Skipf("not available on %s", runtime.GOOS)
 	}
 
 	for _, tt := range packetConnReadWriteMulticastICMPTests {
@@ -149,7 +149,7 @@ func TestPacketConnReadWriteMulticastICMP(t *testing.T) {
 				switch runtime.GOOS {
 				case "freebsd", "linux":
 				default: // platforms that don't support IGMPv2/3 fail here
-					t.Logf("not supported on %q", runtime.GOOS)
+					t.Logf("not supported on %s", runtime.GOOS)
 					continue
 				}
 				t.Fatal(err)
@@ -183,7 +183,7 @@ func TestPacketConnReadWriteMulticastICMP(t *testing.T) {
 			}
 			if err := p.SetControlMessage(cf, toggle); err != nil {
 				if nettest.ProtocolNotSupported(err) {
-					t.Logf("not supported on %q", runtime.GOOS)
+					t.Logf("not supported on %s", runtime.GOOS)
 					continue
 				}
 				t.Fatal(err)
@@ -234,7 +234,7 @@ func TestRawConnReadWriteMulticastICMP(t *testing.T) {
 	}
 	ifi := nettest.RoutedInterface("ip4", net.FlagUp|net.FlagMulticast|net.FlagLoopback)
 	if ifi == nil {
-		t.Skipf("not available on %q", runtime.GOOS)
+		t.Skipf("not available on %s", runtime.GOOS)
 	}
 
 	for _, tt := range rawConnReadWriteMulticastICMPTests {
@@ -259,7 +259,7 @@ func TestRawConnReadWriteMulticastICMP(t *testing.T) {
 				switch runtime.GOOS {
 				case "freebsd", "linux":
 				default: // platforms that don't support IGMPv2/3 fail here
-					t.Logf("not supported on %q", runtime.GOOS)
+					t.Logf("not supported on %s", runtime.GOOS)
 					continue
 				}
 				t.Fatal(err)
@@ -301,7 +301,7 @@ func TestRawConnReadWriteMulticastICMP(t *testing.T) {
 			}
 			if err := r.SetControlMessage(cf, toggle); err != nil {
 				if nettest.ProtocolNotSupported(err) {
-					t.Logf("not supported on %q", runtime.GOOS)
+					t.Logf("not supported on %s", runtime.GOOS)
 					continue
 				}
 				t.Fatal(err)

+ 5 - 5
ipv4/multicastlistener_test.go

@@ -22,7 +22,7 @@ var udpMultipleGroupListenerTests = []net.Addr{
 func TestUDPSinglePacketConnWithMultipleGroupListeners(t *testing.T) {
 	switch runtime.GOOS {
 	case "nacl", "plan9", "solaris", "windows":
-		t.Skipf("not supported on %q", runtime.GOOS)
+		t.Skipf("not supported on %s", runtime.GOOS)
 	}
 	if testing.Short() {
 		t.Skip("to avoid external network")
@@ -62,7 +62,7 @@ func TestUDPSinglePacketConnWithMultipleGroupListeners(t *testing.T) {
 func TestUDPMultiplePacketConnWithMultipleGroupListeners(t *testing.T) {
 	switch runtime.GOOS {
 	case "nacl", "plan9", "solaris", "windows":
-		t.Skipf("not supported on %q", runtime.GOOS)
+		t.Skipf("not supported on %s", runtime.GOOS)
 	}
 	if testing.Short() {
 		t.Skip("to avoid external network")
@@ -114,7 +114,7 @@ func TestUDPMultiplePacketConnWithMultipleGroupListeners(t *testing.T) {
 func TestUDPPerInterfaceSinglePacketConnWithSingleGroupListener(t *testing.T) {
 	switch runtime.GOOS {
 	case "nacl", "plan9", "solaris", "windows":
-		t.Skipf("not supported on %q", runtime.GOOS)
+		t.Skipf("not supported on %s", runtime.GOOS)
 	}
 	if testing.Short() {
 		t.Skip("to avoid external network")
@@ -157,7 +157,7 @@ func TestUDPPerInterfaceSinglePacketConnWithSingleGroupListener(t *testing.T) {
 func TestIPSingleRawConnWithSingleGroupListener(t *testing.T) {
 	switch runtime.GOOS {
 	case "nacl", "plan9", "solaris", "windows":
-		t.Skipf("not supported on %q", runtime.GOOS)
+		t.Skipf("not supported on %s", runtime.GOOS)
 	}
 	if testing.Short() {
 		t.Skip("to avoid external network")
@@ -202,7 +202,7 @@ func TestIPSingleRawConnWithSingleGroupListener(t *testing.T) {
 func TestIPPerInterfaceSingleRawConnWithSingleGroupListener(t *testing.T) {
 	switch runtime.GOOS {
 	case "nacl", "plan9", "solaris", "windows":
-		t.Skipf("not supported on %q", runtime.GOOS)
+		t.Skipf("not supported on %s", runtime.GOOS)
 	}
 	if testing.Short() {
 		t.Skip("to avoid external network")

+ 5 - 5
ipv4/multicastsockopt_test.go

@@ -27,11 +27,11 @@ var packetConnMulticastSocketOptionTests = []struct {
 func TestPacketConnMulticastSocketOptions(t *testing.T) {
 	switch runtime.GOOS {
 	case "nacl", "plan9", "solaris":
-		t.Skipf("not supported on %q", runtime.GOOS)
+		t.Skipf("not supported on %s", runtime.GOOS)
 	}
 	ifi := nettest.RoutedInterface("ip4", net.FlagUp|net.FlagMulticast|net.FlagLoopback)
 	if ifi == nil {
-		t.Skipf("not available on %q", runtime.GOOS)
+		t.Skipf("not available on %s", runtime.GOOS)
 	}
 
 	m, ok := nettest.SupportsRawIPSocket()
@@ -67,14 +67,14 @@ var rawConnMulticastSocketOptionTests = []struct {
 func TestRawConnMulticastSocketOptions(t *testing.T) {
 	switch runtime.GOOS {
 	case "nacl", "plan9", "solaris":
-		t.Skipf("not supported on %q", runtime.GOOS)
+		t.Skipf("not supported on %s", runtime.GOOS)
 	}
 	if m, ok := nettest.SupportsRawIPSocket(); !ok {
 		t.Skip(m)
 	}
 	ifi := nettest.RoutedInterface("ip4", net.FlagUp|net.FlagMulticast|net.FlagLoopback)
 	if ifi == nil {
-		t.Skipf("not available on %q", runtime.GOOS)
+		t.Skipf("not available on %s", runtime.GOOS)
 	}
 
 	for _, tt := range rawConnMulticastSocketOptionTests {
@@ -158,7 +158,7 @@ func testSourceSpecificMulticastSocketOptions(t *testing.T, c testIPv4MulticastC
 		switch runtime.GOOS {
 		case "freebsd", "linux":
 		default: // platforms that don't support IGMPv2/3 fail here
-			t.Logf("not supported on %q", runtime.GOOS)
+			t.Logf("not supported on %s", runtime.GOOS)
 			return
 		}
 		t.Error(err)

+ 2 - 2
ipv4/readwrite_test.go

@@ -91,7 +91,7 @@ func benchmarkReadWriteIPv4UDP(b *testing.B, p *ipv4.PacketConn, wb, rb []byte,
 func TestPacketConnConcurrentReadWriteUnicastUDP(t *testing.T) {
 	switch runtime.GOOS {
 	case "nacl", "plan9", "solaris", "windows":
-		t.Skipf("not supported on %q", runtime.GOOS)
+		t.Skipf("not supported on %s", runtime.GOOS)
 	}
 
 	c, err := net.ListenPacket("udp4", "127.0.0.1:0")
@@ -113,7 +113,7 @@ func TestPacketConnConcurrentReadWriteUnicastUDP(t *testing.T) {
 
 	if err := p.SetControlMessage(cf, true); err != nil { // probe before test
 		if nettest.ProtocolNotSupported(err) {
-			t.Skipf("not supported on %q", runtime.GOOS)
+			t.Skipf("not supported on %s", runtime.GOOS)
 		}
 		t.Fatal(err)
 	}

+ 11 - 11
ipv4/unicast_test.go

@@ -21,11 +21,11 @@ import (
 func TestPacketConnReadWriteUnicastUDP(t *testing.T) {
 	switch runtime.GOOS {
 	case "nacl", "plan9", "solaris", "windows":
-		t.Skipf("not supported on %q", runtime.GOOS)
+		t.Skipf("not supported on %s", runtime.GOOS)
 	}
 	ifi := nettest.RoutedInterface("ip4", net.FlagUp|net.FlagLoopback)
 	if ifi == nil {
-		t.Skipf("not available on %q", runtime.GOOS)
+		t.Skipf("not available on %s", runtime.GOOS)
 	}
 
 	c, err := net.ListenPacket("udp4", "127.0.0.1:0")
@@ -46,7 +46,7 @@ func TestPacketConnReadWriteUnicastUDP(t *testing.T) {
 	for i, toggle := range []bool{true, false, true} {
 		if err := p.SetControlMessage(cf, toggle); err != nil {
 			if nettest.ProtocolNotSupported(err) {
-				t.Logf("not supported on %q", runtime.GOOS)
+				t.Logf("not supported on %s", runtime.GOOS)
 				continue
 			}
 			t.Fatal(err)
@@ -77,14 +77,14 @@ func TestPacketConnReadWriteUnicastUDP(t *testing.T) {
 func TestPacketConnReadWriteUnicastICMP(t *testing.T) {
 	switch runtime.GOOS {
 	case "nacl", "plan9", "solaris", "windows":
-		t.Skipf("not supported on %q", runtime.GOOS)
+		t.Skipf("not supported on %s", runtime.GOOS)
 	}
 	if m, ok := nettest.SupportsRawIPSocket(); !ok {
 		t.Skip(m)
 	}
 	ifi := nettest.RoutedInterface("ip4", net.FlagUp|net.FlagLoopback)
 	if ifi == nil {
-		t.Skipf("not available on %q", runtime.GOOS)
+		t.Skipf("not available on %s", runtime.GOOS)
 	}
 
 	c, err := net.ListenPacket("ip4:icmp", "0.0.0.0")
@@ -114,7 +114,7 @@ func TestPacketConnReadWriteUnicastICMP(t *testing.T) {
 		}
 		if err := p.SetControlMessage(cf, toggle); err != nil {
 			if nettest.ProtocolNotSupported(err) {
-				t.Logf("not supported on %q", runtime.GOOS)
+				t.Logf("not supported on %s", runtime.GOOS)
 				continue
 			}
 			t.Fatal(err)
@@ -136,7 +136,7 @@ func TestPacketConnReadWriteUnicastICMP(t *testing.T) {
 		if n, cm, _, err := p.ReadFrom(rb); err != nil {
 			switch runtime.GOOS {
 			case "darwin": // older darwin kernels have some limitation on receiving icmp packet through raw socket
-				t.Logf("not supported on %q", runtime.GOOS)
+				t.Logf("not supported on %s", runtime.GOOS)
 				continue
 			}
 			t.Fatal(err)
@@ -160,14 +160,14 @@ func TestPacketConnReadWriteUnicastICMP(t *testing.T) {
 func TestRawConnReadWriteUnicastICMP(t *testing.T) {
 	switch runtime.GOOS {
 	case "nacl", "plan9", "solaris", "windows":
-		t.Skipf("not supported on %q", runtime.GOOS)
+		t.Skipf("not supported on %s", runtime.GOOS)
 	}
 	if m, ok := nettest.SupportsRawIPSocket(); !ok {
 		t.Skip(m)
 	}
 	ifi := nettest.RoutedInterface("ip4", net.FlagUp|net.FlagLoopback)
 	if ifi == nil {
-		t.Skipf("not available on %q", runtime.GOOS)
+		t.Skipf("not available on %s", runtime.GOOS)
 	}
 
 	c, err := net.ListenPacket("ip4:icmp", "0.0.0.0")
@@ -209,7 +209,7 @@ func TestRawConnReadWriteUnicastICMP(t *testing.T) {
 		}
 		if err := r.SetControlMessage(cf, toggle); err != nil {
 			if nettest.ProtocolNotSupported(err) {
-				t.Logf("not supported on %q", runtime.GOOS)
+				t.Logf("not supported on %s", runtime.GOOS)
 				continue
 			}
 			t.Fatal(err)
@@ -228,7 +228,7 @@ func TestRawConnReadWriteUnicastICMP(t *testing.T) {
 		if _, b, cm, err := r.ReadFrom(rb); err != nil {
 			switch runtime.GOOS {
 			case "darwin": // older darwin kernels have some limitation on receiving icmp packet through raw socket
-				t.Logf("not supported on %q", runtime.GOOS)
+				t.Logf("not supported on %s", runtime.GOOS)
 				continue
 			}
 			t.Fatal(err)

+ 7 - 7
ipv4/unicastsockopt_test.go

@@ -17,11 +17,11 @@ import (
 func TestConnUnicastSocketOptions(t *testing.T) {
 	switch runtime.GOOS {
 	case "nacl", "plan9", "solaris":
-		t.Skipf("not supported on %q", runtime.GOOS)
+		t.Skipf("not supported on %s", runtime.GOOS)
 	}
 	ifi := nettest.RoutedInterface("ip4", net.FlagUp|net.FlagLoopback)
 	if ifi == nil {
-		t.Skipf("not available on %q", runtime.GOOS)
+		t.Skipf("not available on %s", runtime.GOOS)
 	}
 
 	ln, err := net.Listen("tcp4", "127.0.0.1:0")
@@ -54,11 +54,11 @@ var packetConnUnicastSocketOptionTests = []struct {
 func TestPacketConnUnicastSocketOptions(t *testing.T) {
 	switch runtime.GOOS {
 	case "nacl", "plan9", "solaris":
-		t.Skipf("not supported on %q", runtime.GOOS)
+		t.Skipf("not supported on %s", runtime.GOOS)
 	}
 	ifi := nettest.RoutedInterface("ip4", net.FlagUp|net.FlagLoopback)
 	if ifi == nil {
-		t.Skipf("not available on %q", runtime.GOOS)
+		t.Skipf("not available on %s", runtime.GOOS)
 	}
 
 	m, ok := nettest.SupportsRawIPSocket()
@@ -80,14 +80,14 @@ func TestPacketConnUnicastSocketOptions(t *testing.T) {
 func TestRawConnUnicastSocketOptions(t *testing.T) {
 	switch runtime.GOOS {
 	case "nacl", "plan9", "solaris":
-		t.Skipf("not supported on %q", runtime.GOOS)
+		t.Skipf("not supported on %s", runtime.GOOS)
 	}
 	if m, ok := nettest.SupportsRawIPSocket(); !ok {
 		t.Skip(m)
 	}
 	ifi := nettest.RoutedInterface("ip4", net.FlagUp|net.FlagLoopback)
 	if ifi == nil {
-		t.Skipf("not available on %q", runtime.GOOS)
+		t.Skipf("not available on %s", runtime.GOOS)
 	}
 
 	c, err := net.ListenPacket("ip4:icmp", "127.0.0.1")
@@ -116,7 +116,7 @@ func testUnicastSocketOptions(t *testing.T, c testIPv4UnicastConn) {
 	switch runtime.GOOS {
 	case "windows":
 		// IP_TOS option is supported on Windows 8 and beyond.
-		t.Skipf("not supported on %q", runtime.GOOS)
+		t.Skipf("not supported on %s", runtime.GOOS)
 	}
 
 	if err := c.SetTOS(tos); err != nil {