update tests

This commit is contained in:
vyzo 2019-01-18 15:53:16 +02:00
parent f2ee9b3d44
commit 2843bd30d1
3 changed files with 13 additions and 13 deletions

View File

@ -149,7 +149,7 @@ func TestDBRegistrationAndDiscovery(t *testing.T) {
addrs2 := [][]byte{addr2.Bytes()}
// register p1 and do discovery
err = db.Register(p1, "foo1", addrs1, 60)
_, err = db.Register(p1, "foo1", addrs1, 60)
if err != nil {
t.Fatal(err)
}
@ -178,7 +178,7 @@ func TestDBRegistrationAndDiscovery(t *testing.T) {
}
// register p2 and do progressive discovery
err = db.Register(p2, "foo1", addrs2, 60)
_, err = db.Register(p2, "foo1", addrs2, 60)
if err != nil {
t.Fatal(err)
}
@ -207,7 +207,7 @@ func TestDBRegistrationAndDiscovery(t *testing.T) {
}
// reregister p1 and do progressive discovery
err = db.Register(p1, "foo1", addrs1, 60)
_, err = db.Register(p1, "foo1", addrs1, 60)
if err != nil {
t.Fatal(err)
}
@ -319,12 +319,12 @@ func TestDBRegistrationAndDiscoveryMultipleNS(t *testing.T) {
}
addrs2 := [][]byte{addr2.Bytes()}
err = db.Register(p1, "foo1", addrs1, 60)
_, err = db.Register(p1, "foo1", addrs1, 60)
if err != nil {
t.Fatal(err)
}
err = db.Register(p1, "foo2", addrs1, 60)
_, err = db.Register(p1, "foo2", addrs1, 60)
if err != nil {
t.Fatal(err)
}
@ -366,12 +366,12 @@ func TestDBRegistrationAndDiscoveryMultipleNS(t *testing.T) {
t.Fatal("expected p1's addrs in registration")
}
err = db.Register(p2, "foo1", addrs2, 60)
_, err = db.Register(p2, "foo1", addrs2, 60)
if err != nil {
t.Fatal(err)
}
err = db.Register(p2, "foo2", addrs2, 60)
_, err = db.Register(p2, "foo2", addrs2, 60)
if err != nil {
t.Fatal(err)
}
@ -475,7 +475,7 @@ func TestDBCleanup(t *testing.T) {
}
addrs1 := [][]byte{addr1.Bytes()}
err = db.Register(p1, "foo1", addrs1, 1)
_, err = db.Register(p1, "foo1", addrs1, 1)
if err != nil {
t.Fatal(err)
}

View File

@ -60,9 +60,9 @@
},
{
"author": "whyrusleeping",
"hash": "QmcD6i5pkzKcy5AiSEU22xmj8MYkkPSaXVvbYo7Wx2hp6H",
"name": "go-libp2p-netutil",
"version": "0.4.18"
"hash": "QmegQFxhr1J6yZ1vDQuDmJi5jntmj6BL96S11HVtXNCaHb",
"name": "go-libp2p-swarm",
"version": "3.0.28"
}
],
"gxVersion": "0.12.1",

View File

@ -13,9 +13,9 @@ import (
bhost "github.com/libp2p/go-libp2p-blankhost"
host "github.com/libp2p/go-libp2p-host"
inet "github.com/libp2p/go-libp2p-net"
netutil "github.com/libp2p/go-libp2p-netutil"
peer "github.com/libp2p/go-libp2p-peer"
pstore "github.com/libp2p/go-libp2p-peerstore"
testutil "github.com/libp2p/go-libp2p-swarm/testing"
)
func getRendezvousHosts(t *testing.T, ctx context.Context, n int) []host.Host {
@ -30,7 +30,7 @@ func getNetHosts(t *testing.T, ctx context.Context, n int) []host.Host {
var out []host.Host
for i := 0; i < n; i++ {
netw := netutil.GenSwarmNetwork(t, ctx)
netw := testutil.GenSwarmNetwork(t, ctx)
h := bhost.NewBlankHost(netw)
out = append(out, h)
}