fix build without deprecated functions

This commit is contained in:
arvidn 2017-03-08 18:32:58 -05:00 committed by Arvid Norberg
parent 6d54c20adf
commit 6929d051f1
7 changed files with 17 additions and 15 deletions

View File

@ -497,7 +497,7 @@ variant test_release : release
: <asserts>production <debug-symbols>on
<invariant-checks>full <boost-link>shared <optimization>off
<export-extra>on <debug-iterators>on <threading>multi
<inlining>on
<inlining>on <deprecated-functions>off
;
variant test_debug : debug
: <logging>on

View File

@ -66,8 +66,7 @@ TORRENT_TEST(close_file_interval)
}
torrent_handle h = ses.get_torrents().front();
std::vector<pool_file_status> file_status;
h.file_status(file_status);
std::vector<pool_file_status> file_status = h.file_status();
printf("%d: %d files\n", ticks, int(file_status.size()));
if (ticks > 0 && ticks < 19)
{

View File

@ -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<entry> 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<save_resume_data_alert>(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);
}
}

View File

@ -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)
{

View File

@ -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<int>(total_seconds(ae.next_announce - clock_type::now()));
#endif
TEST_CHECK(delay > last);
last = delay;

View File

@ -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);

View File

@ -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)