aboutsummaryrefslogtreecommitdiff
path: root/meta/torrent_test.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-07-18 13:10:27 +0200
committerDimitri Sokolyuk <demon@dim13.org>2016-07-18 13:10:27 +0200
commitad55cd39c9ca982b8cbc40712885d3ad8a5bea52 (patch)
treeb6a86d526aa7fcb467544d658c20b8ff2f961e08 /meta/torrent_test.go
parent7dae66f8be53b8b5ca64d42d3f7849d06068f247 (diff)
Unmarshal Pieces
Diffstat (limited to 'meta/torrent_test.go')
-rw-r--r--meta/torrent_test.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/meta/torrent_test.go b/meta/torrent_test.go
index d8706e0..78d6c77 100644
--- a/meta/torrent_test.go
+++ b/meta/torrent_test.go
@@ -24,9 +24,9 @@ func TestPieces(t *testing.T) {
if err != nil {
t.Error(err)
}
- for i, p := range tor.Info.GetPieces() {
- n, off := tor.Info.findFirstFile(p.Offset)
- t.Log(i, n, off)
+ for i, p := range tor.Info.Pieces {
+ n, off := tor.Info.findFirstFile(int64(tor.Info.PieceLength * i))
+ t.Log(i, n, off, p)
}
}
@@ -35,7 +35,7 @@ func TestPieces2(t *testing.T) {
if err != nil {
t.Error(err)
}
- for i, p := range tor.Info.GetPieces() {
+ for i, p := range tor.Info.Pieces {
t.Logf("%d %x\n", i, p)
}
}