test_ssl and test_transfer polish

This commit is contained in:
Arvid Norberg 2013-07-30 04:30:19 +00:00
parent 6cf5466f5f
commit 68db0038e5
2 changed files with 5 additions and 3 deletions

View File

@ -78,7 +78,7 @@ int peer_disconnects = 0;
bool predicate(alert* a) bool predicate(alert* a)
{ {
if (peer_disconnected_alert* p = alert_cast<peer_disconnected_alert>(a)) if (alert_cast<peer_disconnected_alert>(a))
++peer_disconnects; ++peer_disconnects;
return false; return false;
} }
@ -178,7 +178,8 @@ void test_ssl(int test_idx)
TEST_CHECK(st1.state == torrent_status::seeding TEST_CHECK(st1.state == torrent_status::seeding
|| st1.state == torrent_status::checking_files); || st1.state == torrent_status::checking_files);
TEST_CHECK(st2.state == torrent_status::downloading); TEST_CHECK(st2.state == torrent_status::downloading
|| st2.state == torrent_status::checking_files);
test_sleep(100); test_sleep(100);
} }

View File

@ -57,7 +57,7 @@ int peer_disconnects = 0;
bool predicate(alert* a) bool predicate(alert* a)
{ {
if (peer_disconnected_alert* p = alert_cast<peer_disconnected_alert>(a)) if (alert_cast<peer_disconnected_alert>(a))
++peer_disconnects; ++peer_disconnects;
return false; return false;
} }
@ -414,6 +414,7 @@ void test_transfer(int proxy_type, bool test_disk_full = false, bool test_allowe
TEST_CHECK(st1.state == torrent_status::seeding TEST_CHECK(st1.state == torrent_status::seeding
|| st1.state == torrent_status::checking_files); || st1.state == torrent_status::checking_files);
TEST_CHECK(st2.state == torrent_status::downloading TEST_CHECK(st2.state == torrent_status::downloading
|| st2.state == torrent_status::checking_files
|| (test_disk_full && !st2.error.empty())); || (test_disk_full && !st2.error.empty()));
if (peer_disconnects == 2) break; if (peer_disconnects == 2) break;