From 2852fee3571b5f78491c71c8ed107e342cf7c6ca Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Sat, 16 Jun 2018 17:01:21 +1000 Subject: [PATCH] Fix some testing code for Config->ClientConfig --- torrent_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/torrent_test.go b/torrent_test.go index c9ea5e42..33eb4903 100644 --- a/torrent_test.go +++ b/torrent_test.go @@ -80,7 +80,7 @@ func BenchmarkUpdatePiecePriorities(b *testing.B) { numPieces = 13410 pieceLength = 256 << 10 ) - cl := &Client{} + cl := &Client{config: &ClientConfig{}} cl.initLogger() t := cl.newTorrent(metainfo.Hash{}, nil) require.NoError(b, t.setInfo(&metainfo.Info{ @@ -107,7 +107,7 @@ func BenchmarkUpdatePiecePriorities(b *testing.B) { // Check that a torrent containing zero-length file(s) will start, and that // they're created in the filesystem. The client storage is assumed to be // file-based on the native filesystem based. -func testEmptyFilesAndZeroPieceLength(t *testing.T, cfg *Config) { +func testEmptyFilesAndZeroPieceLength(t *testing.T, cfg *ClientConfig) { cl, err := NewClient(cfg) require.NoError(t, err) defer cl.Close() @@ -149,6 +149,7 @@ func TestEmptyFilesAndZeroPieceLengthWithMMapStorage(t *testing.T) { func TestPieceHashFailed(t *testing.T) { mi := testutil.GreetingMetaInfo() cl := new(Client) + cl.config = &ClientConfig{} cl.initLogger() tt := cl.newTorrent(mi.HashInfoBytes(), badStorage{}) tt.setChunkSize(2) -- 2.48.1