From e7daf8c15a1b0e3afa06fc8ccc5f1fc9d4c8cbaa Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Wed, 6 Jul 2016 03:16:54 +0200 Subject: wip --- meta/torrent_test.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'meta/torrent_test.go') diff --git a/meta/torrent_test.go b/meta/torrent_test.go index c3e960c..d393e45 100644 --- a/meta/torrent_test.go +++ b/meta/torrent_test.go @@ -32,10 +32,9 @@ func TestPieces(t *testing.T) { if err != nil { t.Error(err) } - for i := 0; i < tor.Info.NPieces(); i++ { - off := i * tor.Info.PieceLength - n, foff := tor.Info.FindFile(off) - t.Log(off, n, foff) + for i, p := range tor.Info.GetPieces() { + n, off := tor.Info.FindFile(p.Offset) + t.Log(i, n, off) } } -- cgit v1.2.3