From 3cdf1baaaaede1e9994bcccba27995be7f597aa8 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Tue, 29 Apr 2025 16:37:49 +1000 Subject: [PATCH] Remove missing storage read test that no longer makes sense with part files --- storage/issue96_test.go | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 storage/issue96_test.go 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) -} -- 2.51.0