]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Remove missing storage read test that no longer makes sense with part files
authorMatt Joiner <anacrolix@gmail.com>
Tue, 29 Apr 2025 06:37:49 +0000 (16:37 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Tue, 29 Apr 2025 08:28:19 +0000 (18:28 +1000)
storage/issue96_test.go [deleted file]

diff --git a/storage/issue96_test.go b/storage/issue96_test.go
deleted file mode 100644 (file)
index 7b3e42b..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-package storage
-
-import (
-       "context"
-       "testing"
-
-       g "github.com/anacrolix/generics"
-       "github.com/go-quicktest/qt"
-
-       "github.com/anacrolix/torrent/metainfo"
-)
-
-func testMarkedCompleteMissingOnRead(t *testing.T, csf func(string) ClientImplCloser) {
-       td := t.TempDir()
-       cic := csf(td)
-       defer cic.Close()
-       cs := NewClient(cic)
-       info := &metainfo.Info{
-               PieceLength: 1,
-               Files:       []metainfo.FileInfo{{Path: []string{"a"}, Length: 1}},
-               Pieces:      make([]byte, 20),
-       }
-       ts, err := cs.OpenTorrent(context.Background(), info, metainfo.Hash{})
-       qt.Assert(t, qt.IsNil(err))
-       p := ts.PieceWithHash(info.Piece(0), g.None[[]byte]())
-       qt.Check(t, qt.IsNil(p.MarkComplete()))
-       // qt.Assert(t, qt.IsFalse(p.GetIsComplete()))
-       n, err := p.ReadAt(make([]byte, 1), 0)
-       qt.Check(t, qt.Not(qt.IsNil(err)))
-       qt.Check(t, qt.Equals(n, int(0)))
-       qt.Check(t, qt.IsFalse(p.Completion().Complete))
-}
-
-func TestMarkedCompleteMissingOnReadFile(t *testing.T) {
-       testMarkedCompleteMissingOnRead(t, NewFile)
-}
-
-func TestMarkedCompleteMissingOnReadFileBoltDB(t *testing.T) {
-       testMarkedCompleteMissingOnRead(t, NewBoltDB)
-}