improved debug logging in regression tests

This commit is contained in:
Arvid Norberg 2008-05-12 07:01:25 +00:00
parent 149fa28586
commit 7bde9ef4a9
1 changed files with 7 additions and 1 deletions

View File

@ -27,10 +27,16 @@ void print_alerts(libtorrent::session& ses, char const* name, bool allow_disconn
a = ses.pop_alert(); a = ses.pop_alert();
while (a.get()) while (a.get())
{ {
if (a->msg() != "block downloading" if (peer_disconnected_alert* p = dynamic_cast<peer_disconnected_alert*>(a.get()))
{
std::cerr << name << "(" << p->ip << "): " << p->msg() << "\n";
}
else if (a->msg() != "block downloading"
&& a->msg() != "block finished" && a->msg() != "block finished"
&& a->msg() != "piece finished") && a->msg() != "piece finished")
{
std::cerr << name << ": " << a->msg() << "\n"; std::cerr << name << ": " << a->msg() << "\n";
}
TEST_CHECK(dynamic_cast<peer_error_alert*>(a.get()) == 0 TEST_CHECK(dynamic_cast<peer_error_alert*>(a.get()) == 0
|| (!handles.empty() && h.is_seed()) || (!handles.empty() && h.is_seed())
|| a->msg() == "connecting to peer" || a->msg() == "connecting to peer"