aboutsummaryrefslogtreecommitdiffstats
path: root/p2p/discover/udp_test.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2015-02-05 10:07:18 +0800
committerFelix Lange <fjl@twurst.com>2015-02-06 07:00:36 +0800
commit739066ec56393e63b93531787746fb8ba5f1df15 (patch)
tree6826ff78a688745e7b01044b06b82af9ea51b6e2 /p2p/discover/udp_test.go
parent12224c7f5924720767d73f06ed4571dc3ce2f092 (diff)
downloadgo-tangerine-739066ec56393e63b93531787746fb8ba5f1df15.tar
go-tangerine-739066ec56393e63b93531787746fb8ba5f1df15.tar.gz
go-tangerine-739066ec56393e63b93531787746fb8ba5f1df15.tar.bz2
go-tangerine-739066ec56393e63b93531787746fb8ba5f1df15.tar.lz
go-tangerine-739066ec56393e63b93531787746fb8ba5f1df15.tar.xz
go-tangerine-739066ec56393e63b93531787746fb8ba5f1df15.tar.zst
go-tangerine-739066ec56393e63b93531787746fb8ba5f1df15.zip
p2p/discover: add some helper functions
Diffstat (limited to 'p2p/discover/udp_test.go')
-rw-r--r--p2p/discover/udp_test.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/p2p/discover/udp_test.go b/p2p/discover/udp_test.go
index f2ab2b661..8ed6ec9c0 100644
--- a/p2p/discover/udp_test.go
+++ b/p2p/discover/udp_test.go
@@ -19,8 +19,8 @@ func TestUDP_ping(t *testing.T) {
n1, _ := ListenUDP(newkey(), "127.0.0.1:0")
n2, _ := ListenUDP(newkey(), "127.0.0.1:0")
- defer n1.net.close()
- defer n2.net.close()
+ defer n1.Close()
+ defer n2.Close()
if err := n1.net.ping(n2.self); err != nil {
t.Fatalf("ping error: %v", err)
@@ -49,8 +49,8 @@ func TestUDP_findnode(t *testing.T) {
n1, _ := ListenUDP(newkey(), "127.0.0.1:0")
n2, _ := ListenUDP(newkey(), "127.0.0.1:0")
- defer n1.net.close()
- defer n2.net.close()
+ defer n1.Close()
+ defer n2.Close()
entry := &Node{ID: NodeID{1}, Addr: &net.UDPAddr{IP: net.IP{1, 2, 3, 4}, Port: 15}}
n2.add([]*Node{entry})
@@ -77,7 +77,7 @@ func TestUDP_replytimeout(t *testing.T) {
defer fd.Close()
n1, _ := ListenUDP(newkey(), "127.0.0.1:0")
- defer n1.net.close()
+ defer n1.Close()
n2 := n1.bumpOrAdd(randomID(n1.self.ID, 10), fd.LocalAddr().(*net.UDPAddr))
if err := n1.net.ping(n2); err != errTimeout {
@@ -97,8 +97,8 @@ func TestUDP_findnodeMultiReply(t *testing.T) {
n1, _ := ListenUDP(newkey(), "127.0.0.1:0")
n2, _ := ListenUDP(newkey(), "127.0.0.1:0")
udp2 := n2.net.(*udp)
- defer n1.net.close()
- defer n2.net.close()
+ defer n1.Close()
+ defer n2.Close()
nodes := make([]*Node, bucketSize)
for i := range nodes {