From: Matt Joiner Date: Tue, 29 Apr 2025 06:37:49 +0000 (+1000) Subject: Remove missing storage read test that no longer makes sense with part files X-Git-Tag: v1.59.0~178 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=3cdf1baaaaede1e9994bcccba27995be7f597aa8;p=btrtrc.git Remove missing storage read test that no longer makes sense with part files --- diff --git a/storage/issue96_test.go b/storage/issue96_test.go deleted file mode 100644 index 7b3e42bf..00000000 --- a/storage/issue96_test.go +++ /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) -}