projects
/
btrtrc.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d70f6bc
)
torrentfs tests: Use dynamic port
author
Matt Joiner <anacrolix@gmail.com>
Thu, 20 Nov 2014 02:01:03 +0000 (20:01 -0600)
committer
Matt Joiner <anacrolix@gmail.com>
Thu, 20 Nov 2014 02:01:03 +0000 (20:01 -0600)
fs/torrentfs_test.go
patch
|
blob
|
history
diff --git
a/fs/torrentfs_test.go
b/fs/torrentfs_test.go
index 8c48a00601603cf53012f93e08c1c4432380da87..ba8b5a483779fd671e95ff0b3ad72ee69b74c88d 100644
(file)
--- a/
fs/torrentfs_test.go
+++ b/
fs/torrentfs_test.go
@@
-28,12
+28,7
@@
func init() {
}
func TestTCPAddrString(t *testing.T) {
- ta := &net.TCPAddr{
- IP: net.IPv4(127, 0, 0, 1),
- Port: 3000,
- }
- s := ta.String()
- l, err := net.Listen("tcp4", "localhost:3000")
+ l, err := net.Listen("tcp4", "localhost:0")
if err != nil {
t.Fatal(err)
}
@@
-44,6
+39,11
@@
func TestTCPAddrString(t *testing.T) {
}
defer c.Close()
ras := c.RemoteAddr().String()
+ ta := &net.TCPAddr{
+ IP: net.IPv4(127, 0, 0, 1),
+ Port: util.AddrPort(l.Addr()),
+ }
+ s := ta.String()
if ras != s {
t.FailNow()
}