From a7ed5578b63ef6d88e162e73f6b0a35a5db41abf Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Tue, 8 Jul 2008 00:00:49 +0000 Subject: [PATCH] made the tests build again --- test/setup_transfer.cpp | 24 ++++++++++++------------ test/test_storage.cpp | 4 ++-- test/test_swarm.cpp | 10 +++++----- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/test/setup_transfer.cpp b/test/setup_transfer.cpp index b34d9405f..c0698f7b0 100644 --- a/test/setup_transfer.cpp +++ b/test/setup_transfer.cpp @@ -62,23 +62,23 @@ void print_alerts(libtorrent::session& ses, char const* name, bool allow_disconn { if (peer_disconnected_alert* p = dynamic_cast(a.get())) { - std::cerr << name << "(" << p->ip << "): " << p->msg() << "\n"; + std::cerr << name << "(" << p->ip << "): " << p->message() << "\n"; } - else if (a->msg() != "block downloading" - && a->msg() != "block finished" - && a->msg() != "piece finished") + else if (a->message() != "block downloading" + && a->message() != "block finished" + && a->message() != "piece finished") { - std::cerr << name << ": " << a->msg() << "\n"; + std::cerr << name << ": " << a->message() << "\n"; } TEST_CHECK(dynamic_cast(a.get()) == 0 || (!handles.empty() && h.is_seed()) - || a->msg() == "connecting to peer" - || a->msg() == "closing connection to ourself" - || a->msg() == "duplicate connection" - || a->msg() == "duplicate peer-id, connection closed" - || (allow_disconnects && a->msg() == "Broken pipe") - || (allow_disconnects && a->msg() == "Connection reset by peer") - || (allow_disconnects && a->msg() == "End of file.")); + || a->message() == "connecting to peer" + || a->message() == "closing connection to ourself" + || a->message() == "duplicate connection" + || a->message() == "duplicate peer-id, connection closed" + || (allow_disconnects && a->message() == "Broken pipe") + || (allow_disconnects && a->message() == "Connection reset by peer") + || (allow_disconnects && a->message() == "End of file.")); a = ses.pop_alert(); } } diff --git a/test/test_storage.cpp b/test/test_storage.cpp index 12e751c05..5f9190996 100644 --- a/test/test_storage.cpp +++ b/test/test_storage.cpp @@ -350,7 +350,7 @@ void test_fastresume() { session ses; - ses.set_severity_level(alert::debug); + ses.set_alert_mask(alert::all_categories); torrent_handle h = ses.add_torrent(t, "tmp1", resume , storage_mode_compact); @@ -366,7 +366,7 @@ void test_fastresume() } a = ses.pop_alert(); assert(a.get()); - std::cerr << a->msg() << std::endl; + std::cerr << a->message() << std::endl; } TEST_CHECK(dynamic_cast(a.get()) != 0); } diff --git a/test/test_swarm.cpp b/test/test_swarm.cpp index 5c7ae1bf5..8528aa0a9 100644 --- a/test/test_swarm.cpp +++ b/test/test_swarm.cpp @@ -52,9 +52,9 @@ void test_swarm() session ses2(fingerprint("LT", 0, 1, 0, 0), std::make_pair(49000, 50000)); session ses3(fingerprint("LT", 0, 1, 0, 0), std::make_pair(50000, 51000)); - ses1.set_severity_level(alert::debug); - ses2.set_severity_level(alert::debug); - ses3.set_severity_level(alert::debug); + ses1.set_alert_mask(alert::all_categories); + ses2.set_alert_mask(alert::all_categories); + ses3.set_alert_mask(alert::all_categories); // this is to avoid everything finish from a single peer // immediately. To make the swarm actually connect all @@ -162,7 +162,7 @@ void test_swarm() } a = ses1.pop_alert(); assert(a.get()); - std::cerr << a->msg() << std::endl; + std::cerr << a->message() << std::endl; } TEST_CHECK(dynamic_cast(a.get()) != 0); @@ -174,7 +174,7 @@ void test_swarm() ptime start = time_now(); alert const* ret = ses1.wait_for_alert(seconds(2)); TEST_CHECK(ret == 0); - if (ret != 0) std::cerr << ret->msg() << std::endl; + if (ret != 0) std::cerr << ret->message() << std::endl; TEST_CHECK(time_now() - start < seconds(3)); TEST_CHECK(time_now() - start > seconds(2)); }