forked from premiere/premiere-libtorrent
make tests not use internal aux::time_now function
This commit is contained in:
parent
74ca290fe6
commit
badd763f86
|
@ -191,10 +191,10 @@ void test_swarm(int flags)
|
||||||
ses3.remove_torrent(tor3, lt::session::delete_files);
|
ses3.remove_torrent(tor3, lt::session::delete_files);
|
||||||
|
|
||||||
std::auto_ptr<alert> a = ses1.pop_alert();
|
std::auto_ptr<alert> a = ses1.pop_alert();
|
||||||
time_point end = aux::time_now() + seconds(20);
|
time_point end = clock_type::now() + seconds(20);
|
||||||
while (a.get() == 0 || alert_cast<torrent_deleted_alert>(a.get()) == 0)
|
while (a.get() == 0 || alert_cast<torrent_deleted_alert>(a.get()) == 0)
|
||||||
{
|
{
|
||||||
if (ses1.wait_for_alert(end - aux::time_now()) == 0)
|
if (ses1.wait_for_alert(end - clock_type::now()) == 0)
|
||||||
{
|
{
|
||||||
std::cerr << "wait_for_alert() expired" << std::endl;
|
std::cerr << "wait_for_alert() expired" << std::endl;
|
||||||
break;
|
break;
|
||||||
|
@ -216,7 +216,7 @@ void test_swarm(int flags)
|
||||||
{
|
{
|
||||||
a = ses1.pop_alert();
|
a = ses1.pop_alert();
|
||||||
std::cerr << ret->message() << std::endl;
|
std::cerr << ret->message() << std::endl;
|
||||||
start = aux::time_now();
|
start = clock_type::now();
|
||||||
}
|
}
|
||||||
|
|
||||||
// this allows shutting down the sessions in parallel
|
// this allows shutting down the sessions in parallel
|
||||||
|
|
|
@ -46,7 +46,7 @@ int test_main()
|
||||||
|
|
||||||
address spammer = address_v4::from_string("10.10.10.10");
|
address spammer = address_v4::from_string("10.10.10.10");
|
||||||
|
|
||||||
time_point now = aux::time_now();
|
time_point now = clock_type::now();
|
||||||
for (int i = 0; i < 1000; ++i)
|
for (int i = 0; i < 1000; ++i)
|
||||||
{
|
{
|
||||||
b.incoming(spammer, now);
|
b.incoming(spammer, now);
|
||||||
|
|
|
@ -678,12 +678,12 @@ void test_fastresume(std::string const& test_path)
|
||||||
torrent_handle h = ses.add_torrent(p, ec);
|
torrent_handle h = ses.add_torrent(p, ec);
|
||||||
|
|
||||||
std::auto_ptr<alert> a = ses.pop_alert();
|
std::auto_ptr<alert> a = ses.pop_alert();
|
||||||
time_point end = aux::time_now() + seconds(20);
|
time_point end = clock_type::now() + seconds(20);
|
||||||
while (aux::time_now() < end
|
while (clock_type::now() < end
|
||||||
&& (a.get() == 0
|
&& (a.get() == 0
|
||||||
|| alert_cast<fastresume_rejected_alert>(a.get()) == 0))
|
|| alert_cast<fastresume_rejected_alert>(a.get()) == 0))
|
||||||
{
|
{
|
||||||
if (ses.wait_for_alert(end - aux::time_now()) == 0)
|
if (ses.wait_for_alert(end - clock_type::now()) == 0)
|
||||||
{
|
{
|
||||||
std::cerr << "wait_for_alert() expired" << std::endl;
|
std::cerr << "wait_for_alert() expired" << std::endl;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue