Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
7cac1ef9
Commit
7cac1ef9
authored
Sep 22, 2014
by
Brian Tiger Chow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(net:swarm) test... use netmsg interface
parent
2d2aee15
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
net/swarm/swarm_test.go
net/swarm/swarm_test.go
+4
-4
No files found.
net/swarm/swarm_test.go
View file @
7cac1ef9
...
...
@@ -115,7 +115,7 @@ func TestSwarm(t *testing.T) {
MsgNum
:=
1000
for
k
:=
0
;
k
<
MsgNum
;
k
++
{
for
_
,
p
:=
range
peers
{
swarm
.
Outgoing
<-
&
msg
.
Message
{
Peer
:
p
,
Data
:
[]
byte
(
"ping"
)
}
swarm
.
Outgoing
<-
msg
.
New
(
p
,
[]
byte
(
"ping"
)
)
}
}
...
...
@@ -123,12 +123,12 @@ func TestSwarm(t *testing.T) {
for
k
:=
0
;
k
<
(
MsgNum
*
len
(
peers
));
k
++
{
msg
:=
<-
swarm
.
Incoming
if
string
(
msg
.
Data
)
!=
"pong"
{
if
string
(
msg
.
Data
()
)
!=
"pong"
{
t
.
Error
(
"unexpected conn output"
,
msg
.
Data
)
}
n
,
_
:=
got
[
msg
.
Peer
.
Key
()]
got
[
msg
.
Peer
.
Key
()]
=
n
+
1
n
,
_
:=
got
[
msg
.
Peer
()
.
Key
()]
got
[
msg
.
Peer
()
.
Key
()]
=
n
+
1
}
if
len
(
peers
)
!=
len
(
got
)
{
...
...
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