Fix some testing code for Config->ClientConfig
This commit is contained in:
parent
174120e1e8
commit
2852fee357
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue