first steps towards supporting SSL over uTP. moved the TODO comment and made it describe the next step. Optimized session destruction in unit tests, hopefully shaving off a bit of test run-time (and now supports asio-debugging of unit tests)

This commit is contained in:
Arvid Norberg
2013-08-31 20:19:03 +00:00
parent ea4dbf603f
commit b6083fbc28
10 changed files with 133 additions and 13 deletions

View File

@@ -48,6 +48,13 @@ void test_transfer(bool clear_files, bool disconnect
{
using namespace libtorrent;
// these are declared before the session objects
// so that they are destructed last. This enables
// the sessions to destruct in parallel
session_proxy p1;
session_proxy p2;
session_proxy p3;
session ses1(fingerprint("LT", 0, 1, 0, 0), std::make_pair(48100, 49000), "0.0.0.0", 0);
session ses2(fingerprint("LT", 0, 1, 0, 0), std::make_pair(49100, 50000), "0.0.0.0", 0);
session ses3(fingerprint("LT", 0, 1, 0, 0), std::make_pair(50100, 51000), "0.0.0.0", 0);
@@ -102,6 +109,11 @@ void test_transfer(bool clear_files, bool disconnect
TEST_CHECK(tor2.status().is_seeding);
if (tor2.status().is_seeding) std::cerr << "done\n";
// this allows shutting down the sessions in parallel
p1 = ses1.abort();
p2 = ses2.abort();
p3 = ses3.abort();
error_code ec;
remove_all("tmp1_meta", ec);
remove_all("tmp2_meta", ec);