numPieces = 13410
pieceLength = 256 << 10
)
- cl := &Client{config: TestingConfig()}
+ cl := &Client{config: TestingConfig(b)}
cl.initLogger()
t := cl.newTorrent(metainfo.Hash{}, nil)
require.NoError(b, t.setInfo(&metainfo.Info{
}
func TestEmptyFilesAndZeroPieceLengthWithFileStorage(t *testing.T) {
- cfg := TestingConfig()
+ cfg := TestingConfig(t)
ci := storage.NewFile(cfg.DataDir)
defer ci.Close()
cfg.DefaultStorage = ci
}
func TestEmptyFilesAndZeroPieceLengthWithMMapStorage(t *testing.T) {
- cfg := TestingConfig()
+ cfg := TestingConfig(t)
ci := storage.NewMMap(cfg.DataDir)
defer ci.Close()
cfg.DefaultStorage = ci
func TestPieceHashFailed(t *testing.T) {
mi := testutil.GreetingMetaInfo()
cl := new(Client)
- cl.config = TestingConfig()
+ cl.config = TestingConfig(t)
cl.initLogger()
tt := cl.newTorrent(mi.HashInfoBytes(), badStorage{})
tt.setChunkSize(2)
// Check the behaviour of Torrent.Metainfo when metadata is not completed.
func TestTorrentMetainfoIncompleteMetadata(t *testing.T) {
- cfg := TestingConfig()
+ cfg := TestingConfig(t)
cfg.Debug = true
cl, err := NewClient(cfg)
require.NoError(t, err)