Skip to content

Commit

Permalink
Fix use-after-move in test_storage
Browse files Browse the repository at this point in the history
  • Loading branch information
glassez committed Feb 16, 2025
1 parent ea1aa43 commit dd85995
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/test_storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -928,11 +928,12 @@ void test_fastresume(bool const test_deprecated)
p.storage_mode = storage_mode_sparse;
error_code ignore;
torrent_handle h = ses.add_torrent(std::move(p), ignore);
TEST_CHECK(exists(combine_path(p.save_path, "temporary")));
if (!exists(combine_path(p.save_path, "temporary")))

torrent_status s = h.status();
TEST_CHECK(exists(combine_path(s.save_path, "temporary")));
if (!exists(combine_path(s.save_path, "temporary")))
return;

torrent_status s;
for (int i = 0; i < 50; ++i)
{
print_alerts(ses, "ses");
Expand Down

0 comments on commit dd85995

Please sign in to comment.