From a641f66258855ebc1b23925fde7baa6f276db9d9 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Mon, 18 Jan 2010 07:02:56 +0000 Subject: [PATCH] use alert_cast instead of dynamic_cast in unit tests --- test/setup_transfer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/setup_transfer.cpp b/test/setup_transfer.cpp index 5c2ffd387..f3a92211a 100644 --- a/test/setup_transfer.cpp +++ b/test/setup_transfer.cpp @@ -78,7 +78,7 @@ bool print_alerts(libtorrent::session& ses, char const* name while (a.get()) { if (predicate && predicate(a.get())) ret = true; - if (peer_disconnected_alert* p = dynamic_cast(a.get())) + if (peer_disconnected_alert* p = alert_cast(a.get())) { fprintf(stderr, "%s(%s): %s\n", name, print_endpoint(p->ip).c_str(), p->message().c_str()); } @@ -88,9 +88,9 @@ bool print_alerts(libtorrent::session& ses, char const* name { fprintf(stderr, "%s: %s\n", name, a->message().c_str()); } - TEST_CHECK(dynamic_cast(a.get()) == 0 || allow_failed_fastresume); + TEST_CHECK(alert_cast(a.get()) == 0 || allow_failed_fastresume); - TEST_CHECK(dynamic_cast(a.get()) == 0 + TEST_CHECK(alert_cast(a.get()) == 0 || (!handles.empty() && h.is_seed()) || a->message() == "connecting to peer" || a->message() == "closing connection to ourself"