Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
ecdd9f23
Commit
ecdd9f23
authored
Feb 29, 2012
by
Mikio Hara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
net: minor fixes to test
R=golang-dev, r CC=golang-dev
https://golang.org/cl/5707058
parent
ee149d9a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
src/pkg/net/dial_test.go
src/pkg/net/dial_test.go
+1
-1
src/pkg/net/udp_test.go
src/pkg/net/udp_test.go
+5
-5
No files found.
src/pkg/net/dial_test.go
View file @
ecdd9f23
...
...
@@ -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
{
...
...
src/pkg/net/udp_test.go
View file @
ecdd9f23
...
...
@@ -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
"
)
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment