diff --git a/Jamfile b/Jamfile index 55c4f8d1b..057250f7d 100644 --- a/Jamfile +++ b/Jamfile @@ -497,7 +497,7 @@ variant test_release : release : production on full shared off on on multi - on + on off ; variant test_debug : debug : on diff --git a/simulation/test_file_pool.cpp b/simulation/test_file_pool.cpp index d1f250d10..a26a67f3b 100644 --- a/simulation/test_file_pool.cpp +++ b/simulation/test_file_pool.cpp @@ -66,8 +66,7 @@ TORRENT_TEST(close_file_interval) } torrent_handle h = ses.get_torrents().front(); - std::vector file_status; - h.file_status(file_status); + std::vector file_status = h.file_status(); printf("%d: %d files\n", ticks, int(file_status.size())); if (ticks > 0 && ticks < 19) { diff --git a/simulation/test_save_resume.cpp b/simulation/test_save_resume.cpp index f0d87968c..026a3c4c7 100644 --- a/simulation/test_save_resume.cpp +++ b/simulation/test_save_resume.cpp @@ -35,13 +35,14 @@ POSSIBILITY OF SUCH DAMAGE. #include "utils.hpp" #include "libtorrent/alert_types.hpp" #include "libtorrent/session.hpp" +#include "libtorrent/write_resume_data.hpp" #include "settings.hpp" using namespace libtorrent; TORRENT_TEST(seed_and_suggest_mode) { - std::shared_ptr resume_data; + add_torrent_params resume_data; // with seed mode setup_swarm(2, swarm_test::upload @@ -59,7 +60,7 @@ TORRENT_TEST(seed_and_suggest_mode) auto* sr = alert_cast(a); if (sr == nullptr) return; - resume_data = sr->resume_data; + resume_data = sr->params; } // terminate , [](int ticks, lt::session& ses) -> bool @@ -73,16 +74,14 @@ TORRENT_TEST(seed_and_suggest_mode) return true; }); - printf("save-resume: %s\n", resume_data->to_string().c_str()); - TEST_CHECK((*resume_data)["seed_mode"] == 1); + printf("save-resume: %s\n", write_resume_data(resume_data).to_string().c_str()); + TEST_CHECK(resume_data.flags & add_torrent_params::flag_seed_mode); // there should not be any pieces in a seed-mode torrent - entry const* pieces = resume_data->find_key("pieces"); - TEST_CHECK(pieces != nullptr); - std::string piece_str = pieces->string(); - for (char c : piece_str) + auto const pieces = resume_data.have_pieces; + for (bool const c : pieces) { - TEST_CHECK(c & 0x1); + TEST_CHECK(c); } } diff --git a/simulation/test_swarm.cpp b/simulation/test_swarm.cpp index dab11d954..15093e19b 100644 --- a/simulation/test_swarm.cpp +++ b/simulation/test_swarm.cpp @@ -520,12 +520,14 @@ TORRENT_TEST(redundant_have) ); } +#ifndef TORRENT_NO_DEPRECATE TORRENT_TEST(lazy_bitfields) { test_settings([](lt::settings_pack& pack) { pack.set_bool(settings_pack::lazy_bitfields, true); } ); } +#endif TORRENT_TEST(prioritize_partial_pieces) { diff --git a/test/test_primitives.cpp b/test/test_primitives.cpp index f152ce672..fdafd047f 100644 --- a/test/test_primitives.cpp +++ b/test/test_primitives.cpp @@ -58,7 +58,7 @@ TORRENT_TEST(primitives) #ifndef TORRENT_NO_DEPRECATE int const delay = ae.next_announce_in(); #else - int const delay = total_seconds(ae.next_announce - clock_type::now()); + int const delay = static_cast(total_seconds(ae.next_announce - clock_type::now())); #endif TEST_CHECK(delay > last); last = delay; diff --git a/test/test_resume.cpp b/test/test_resume.cpp index 27d32c25a..28d109fa9 100644 --- a/test/test_resume.cpp +++ b/test/test_resume.cpp @@ -331,7 +331,7 @@ TORRENT_TEST(resume_save_load_deprecated) TEST_CHECK(a); if (a == nullptr) return; - auto const l = a->params.file_priority; + auto const l = a->params.file_priorities; TEST_EQUAL(l.size(), 3); TEST_EQUAL(l[0], 1); @@ -353,7 +353,7 @@ TORRENT_TEST(resume_save_load_resume_deprecated) TEST_CHECK(a); if (a == nullptr) return; - auto const l = a->params.file_priority; + auto const l = a->params.file_priorities; TEST_EQUAL(l.size(), 3); TEST_EQUAL(l[0], 1); diff --git a/test/test_storage.cpp b/test/test_storage.cpp index c6e4e9577..6b9e0f4a9 100644 --- a/test/test_storage.cpp +++ b/test/test_storage.cpp @@ -803,7 +803,9 @@ TORRENT_TEST(rename_file) auto const files = resume.renamed_files; for (auto const& i : files) + { TEST_EQUAL(i.second.substr(0, 14), "temp_storage__"); + } } void test_rename_file_fastresume(bool test_deprecated)