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
3b858fb8
Commit
3b858fb8
authored
Dec 03, 2009
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
net: turn off empty packet test by default
Fixes #374. R=r
https://golang.org/cl/166053
parent
9da6666a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
src/pkg/net/server_test.go
src/pkg/net/server_test.go
+9
-2
No files found.
src/pkg/net/server_test.go
View file @
3b858fb8
...
...
@@ -5,6 +5,7 @@
package
net
import
(
"flag"
;
"io"
;
"os"
;
"strings"
;
...
...
@@ -12,6 +13,12 @@ import (
"testing"
;
)
// Do not test empty datagrams by default.
// It causes unexplained timeouts on some systems,
// including Snow Leopard. I think that the kernel
// doesn't quite expect them.
var
testEmptyDatagrams
=
flag
.
Bool
(
"empty_datagrams"
,
false
,
"whether to test empty datagrams"
)
func
runEcho
(
fd
io
.
ReadWriter
,
done
chan
<-
int
)
{
var
buf
[
1024
]
byte
;
...
...
@@ -155,7 +162,7 @@ func doTestPacket(t *testing.T, network, listenaddr, dialaddr string, isEmpty bo
}
func
TestUDPServer
(
t
*
testing
.
T
)
{
for
_
,
isEmpty
:=
range
[]
bool
{
false
,
true
}
{
for
_
,
isEmpty
:=
range
[]
bool
{
false
,
*
testEmptyDatagrams
}
{
doTestPacket
(
t
,
"udp"
,
"0.0.0.0"
,
"127.0.0.1"
,
isEmpty
);
doTestPacket
(
t
,
"udp"
,
""
,
"127.0.0.1"
,
isEmpty
);
if
kernelSupportsIPv6
()
{
...
...
@@ -167,7 +174,7 @@ func TestUDPServer(t *testing.T) {
}
func
TestUnixDatagramServer
(
t
*
testing
.
T
)
{
for
_
,
isEmpty
:=
range
[]
bool
{
false
,
true
}
{
for
_
,
isEmpty
:=
range
[]
bool
{
false
,
*
testEmptyDatagrams
}
{
os
.
Remove
(
"/tmp/gotest1.net"
);
os
.
Remove
(
"/tmp/gotest1.net.local"
);
doTestPacket
(
t
,
"unixgram"
,
"/tmp/gotest1.net"
,
"/tmp/gotest1.net"
,
isEmpty
);
...
...
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