forked from premiere/premiere-libtorrent
fixed test_swarm
This commit is contained in:
parent
81a88a774f
commit
186561e5ff
|
@ -172,11 +172,15 @@ void test_swarm()
|
||||||
// this should time out (ret == 0) and it should take
|
// this should time out (ret == 0) and it should take
|
||||||
// about 2 seconds
|
// about 2 seconds
|
||||||
ptime start = time_now();
|
ptime start = time_now();
|
||||||
alert const* ret = ses1.wait_for_alert(seconds(2));
|
alert const* ret;
|
||||||
TEST_CHECK(ret == 0);
|
while (ret = ses1.wait_for_alert(seconds(2)))
|
||||||
if (ret != 0) std::cerr << ret->message() << std::endl;
|
{
|
||||||
|
a = ses1.pop_alert();
|
||||||
|
std::cerr << ret->message() << std::endl;
|
||||||
|
start = time_now();
|
||||||
|
}
|
||||||
TEST_CHECK(time_now() - start < seconds(3));
|
TEST_CHECK(time_now() - start < seconds(3));
|
||||||
TEST_CHECK(time_now() - start > seconds(2));
|
TEST_CHECK(time_now() - start >= seconds(2));
|
||||||
}
|
}
|
||||||
|
|
||||||
int test_main()
|
int test_main()
|
||||||
|
|
Loading…
Reference in New Issue