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
06d4df23
Commit
06d4df23
authored
Dec 18, 2014
by
Brian Tiger Chow
Committed by
Juan Batiz-Benet
Dec 23, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
misc naming
License: MIT Signed-off-by:
Brian Tiger Chow
<
brian@perfmode.com
>
parent
e3f8f8cc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
net/net_test.go
net/net_test.go
+9
-9
No files found.
net/net_test.go
View file @
06d4df23
...
...
@@ -36,28 +36,28 @@ func TestConnectednessCorrect(t *testing.T) {
// test those connected show up correctly
// test connected
tes
tConnectedness
(
t
,
nets
[
0
],
nets
[
1
],
inet
.
Connected
)
tes
tConnectedness
(
t
,
nets
[
0
],
nets
[
3
],
inet
.
Connected
)
tes
tConnectedness
(
t
,
nets
[
1
],
nets
[
2
],
inet
.
Connected
)
tes
tConnectedness
(
t
,
nets
[
3
],
nets
[
2
],
inet
.
Connected
)
expec
tConnectedness
(
t
,
nets
[
0
],
nets
[
1
],
inet
.
Connected
)
expec
tConnectedness
(
t
,
nets
[
0
],
nets
[
3
],
inet
.
Connected
)
expec
tConnectedness
(
t
,
nets
[
1
],
nets
[
2
],
inet
.
Connected
)
expec
tConnectedness
(
t
,
nets
[
3
],
nets
[
2
],
inet
.
Connected
)
// test not connected
tes
tConnectedness
(
t
,
nets
[
0
],
nets
[
2
],
inet
.
NotConnected
)
tes
tConnectedness
(
t
,
nets
[
1
],
nets
[
3
],
inet
.
NotConnected
)
expec
tConnectedness
(
t
,
nets
[
0
],
nets
[
2
],
inet
.
NotConnected
)
expec
tConnectedness
(
t
,
nets
[
1
],
nets
[
3
],
inet
.
NotConnected
)
for
_
,
n
:=
range
nets
{
n
.
Close
()
}
}
func
tes
tConnectedness
(
t
*
testing
.
T
,
a
,
b
inet
.
Network
,
c
inet
.
Connectedness
)
{
func
expec
tConnectedness
(
t
*
testing
.
T
,
a
,
b
inet
.
Network
,
expected
inet
.
Connectedness
)
{
es
:=
"%s is connected to %s, but Connectedness incorrect. %s %s"
if
a
.
Connectedness
(
b
.
LocalPeer
())
!=
c
{
if
a
.
Connectedness
(
b
.
LocalPeer
())
!=
expected
{
t
.
Errorf
(
es
,
a
,
b
,
printConns
(
a
),
printConns
(
b
))
}
// test symmetric case
if
b
.
Connectedness
(
a
.
LocalPeer
())
!=
c
{
if
b
.
Connectedness
(
a
.
LocalPeer
())
!=
expected
{
t
.
Errorf
(
es
,
b
,
a
,
printConns
(
b
),
printConns
(
a
))
}
}
...
...
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