Commit ecdd9f23 authored by Mikio Hara's avatar Mikio Hara

net: minor fixes to test

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5707058
parent ee149d9a
......@@ -186,7 +186,7 @@ var duplicateErrorPattern = `dial (.*) dial (.*)`
func TestDialError(t *testing.T) {
if !*runErrorTest {
t.Logf("test disabled; use --run_error_test to enable")
t.Logf("test disabled; use -run_error_test to enable")
return
}
for i, tt := range dialErrorTests {
......
......@@ -38,18 +38,18 @@ func testWriteToConn(t *testing.T, raddr string) {
_, err = c.(*UDPConn).WriteToUDP([]byte("Connection-oriented mode socket"), ra)
if err == nil {
t.Fatal("WriteToUDP should be failed")
t.Fatal("WriteToUDP should fail")
}
if err != nil && err.(*OpError).Err != ErrWriteToConnected {
t.Fatalf("WriteToUDP should be failed as ErrWriteToConnected: %v", err)
t.Fatalf("WriteToUDP should fail as ErrWriteToConnected: %v", err)
}
_, err = c.(*UDPConn).WriteTo([]byte("Connection-oriented mode socket"), ra)
if err == nil {
t.Fatal("WriteTo should be failed")
t.Fatal("WriteTo should fail")
}
if err != nil && err.(*OpError).Err != ErrWriteToConnected {
t.Fatalf("WriteTo should be failed as ErrWriteToConnected: %v", err)
t.Fatalf("WriteTo should fail as ErrWriteToConnected: %v", err)
}
_, err = c.Write([]byte("Connection-oriented mode socket"))
......@@ -82,6 +82,6 @@ func testWriteToPacketConn(t *testing.T, raddr string) {
_, err = c.(*UDPConn).Write([]byte("Connection-less mode socket"))
if err == nil {
t.Fatal("Write should be failed")
t.Fatal("Write should fail")
}
}
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