]> Sergey Matveev's repositories - btrtrc.git/blobdiff - connection_test.go
Rename Config->ClientConfig and change how defaults work
[btrtrc.git] / connection_test.go
index f741ac259b4e1e4146d63b96e4362068408d7208..58a92a61a4da9c2c20388dbf9e328f6b9c4e03e6 100644 (file)
@@ -21,7 +21,9 @@ import (
 // Have that would potentially alter it.
 func TestSendBitfieldThenHave(t *testing.T) {
        r, w := io.Pipe()
-       var cl Client
+       cl := Client{
+               config: &ClientConfig{DownloadRateLimiter: unlimited},
+       }
        cl.initLogger()
        c := cl.newConnection(nil, false)
        c.setTorrent(cl.newTorrent(metainfo.Hash{}, nil))
@@ -87,7 +89,9 @@ func (me *torrentStorage) WriteAt(b []byte, _ int64) (int, error) {
 
 func BenchmarkConnectionMainReadLoop(b *testing.B) {
        cl := &Client{
-               downloadLimit: unlimited,
+               config: &ClientConfig{
+                       DownloadRateLimiter: unlimited,
+               },
        }
        ts := &torrentStorage{}
        t := &Torrent{