print even less in test_web_seed

This commit is contained in:
Arvid Norberg 2011-04-10 01:36:07 +00:00
parent ad2f4d1697
commit cb3371dd7f
3 changed files with 8 additions and 5 deletions

View File

@ -74,7 +74,7 @@ void report_failure(char const* err, char const* file, int line)
bool print_alerts(libtorrent::session& ses, char const* name
, bool allow_disconnects, bool allow_no_torrents, bool allow_failed_fastresume
, bool (*predicate)(libtorrent::alert*))
, bool (*predicate)(libtorrent::alert*), bool no_output)
{
bool ret = false;
std::vector<torrent_handle> handles = ses.get_torrents();
@ -92,10 +92,12 @@ bool print_alerts(libtorrent::session& ses, char const* name
}
else if ((*i)->message() != "block downloading"
&& (*i)->message() != "block finished"
&& (*i)->message() != "piece finished")
&& (*i)->message() != "piece finished"
&& !no_output)
{
fprintf(stderr, "%s: %s\n", name, (*i)->message().c_str());
}
TEST_CHECK(alert_cast<fastresume_rejected_alert>(*i) == 0 || allow_failed_fastresume);
peer_error_alert* pea = alert_cast<peer_error_alert>(*i);
@ -130,7 +132,7 @@ void wait_for_listen(libtorrent::session& ses, char const* name)
alert const* a = 0;
do
{
print_alerts(ses, name, true, true, true, &listen_alert);
print_alerts(ses, name, true, true, true, &listen_alert, false);
if (listen_done) break;
a = ses.wait_for_alert(milliseconds(500));
} while (a);

View File

@ -46,7 +46,8 @@ bool print_alerts(libtorrent::session& ses, char const* name
, bool allow_disconnects = false
, bool allow_no_torrents = false
, bool allow_failed_fastresume = false
, bool (*)(libtorrent::alert*) = 0);
, bool (*)(libtorrent::alert*) = 0
, bool no_output = false);
void wait_for_listen(libtorrent::session& ses, char const* name);
void test_sleep(int millisec);

View File

@ -118,7 +118,7 @@ void test_transfer(boost::intrusive_ptr<torrent_info> torrent_file
<< " buffers: " << cs.total_used_buffers
<< std::endl;
*/
print_alerts(ses, " >> ses");
print_alerts(ses, " >> ses", false, false, false, 0, true);
if (s.is_seeding /* && ss.download_rate == 0.f*/)
{