p2p/discovery: fix broken tests due to API update

This commit is contained in:
Péter Szilágyi 2015-04-23 19:40:35 +03:00
parent af923c965f
commit 971702e7a1
2 changed files with 4 additions and 4 deletions

View File

@ -15,7 +15,7 @@ import (
func TestTable_pingReplace(t *testing.T) { func TestTable_pingReplace(t *testing.T) {
doit := func(newNodeIsResponding, lastInBucketIsResponding bool) { doit := func(newNodeIsResponding, lastInBucketIsResponding bool) {
transport := newPingRecorder() transport := newPingRecorder()
tab := newTable(transport, NodeID{}, &net.UDPAddr{}) tab := newTable(transport, NodeID{}, &net.UDPAddr{}, "")
last := fillBucket(tab, 200) last := fillBucket(tab, 200)
pingSender := randomID(tab.self.ID, 200) pingSender := randomID(tab.self.ID, 200)
@ -145,7 +145,7 @@ func TestTable_closest(t *testing.T) {
test := func(test *closeTest) bool { test := func(test *closeTest) bool {
// for any node table, Target and N // for any node table, Target and N
tab := newTable(nil, test.Self, &net.UDPAddr{}) tab := newTable(nil, test.Self, &net.UDPAddr{}, "")
tab.add(test.All) tab.add(test.All)
// check that doClosest(Target, N) returns nodes // check that doClosest(Target, N) returns nodes
@ -217,7 +217,7 @@ func TestTable_Lookup(t *testing.T) {
self := gen(NodeID{}, quickrand).(NodeID) self := gen(NodeID{}, quickrand).(NodeID)
target := randomID(self, 200) target := randomID(self, 200)
transport := findnodeOracle{t, target} transport := findnodeOracle{t, target}
tab := newTable(transport, self, &net.UDPAddr{}) tab := newTable(transport, self, &net.UDPAddr{}, "")
// lookup on empty table returns no nodes // lookup on empty table returns no nodes
if results := tab.Lookup(target); len(results) > 0 { if results := tab.Lookup(target); len(results) > 0 {

View File

@ -41,7 +41,7 @@ func newUDPTest(t *testing.T) *udpTest {
remotekey: newkey(), remotekey: newkey(),
remoteaddr: &net.UDPAddr{IP: net.IP{1, 2, 3, 4}, Port: 30303}, remoteaddr: &net.UDPAddr{IP: net.IP{1, 2, 3, 4}, Port: 30303},
} }
test.table, test.udp = newUDP(test.localkey, test.pipe, nil) test.table, test.udp = newUDP(test.localkey, test.pipe, nil, "")
return test return test
} }