diff --git a/test/test_priority.cpp b/test/test_priority.cpp index 01c7bdfc6..50bb978be 100644 --- a/test/test_priority.cpp +++ b/test/test_priority.cpp @@ -262,6 +262,7 @@ void test_transfer(settings_pack const& sett) time_point start = clock_type::now(); while (true) { + ses2.wait_for_alert(seconds(10)); std::vector alerts; ses2.pop_alerts(&alerts); if (alerts.empty()) break; @@ -275,21 +276,23 @@ void test_transfer(settings_pack const& sett) bencode(std::back_inserter(resume_data) , *alert_cast(a)->resume_data); fprintf(stderr, "saved resume data\n"); - break; + goto done; } else if (alert_cast(a)) { fprintf(stderr, "save resume failed\n"); - break; + goto done; } if (total_seconds(clock_type::now() - start) > 10) - break; - - ses2.wait_for_alert(seconds(10)); + goto done; } } +done: TEST_CHECK(resume_data.size()); + if (resume_data.empty()) + return; + fprintf(stderr, "%s\n", &resume_data[0]); ses2.remove_torrent(tor2);