make tests not use internal aux::time_now function

This commit is contained in:
Arvid Norberg 2015-03-15 15:22:01 +00:00
parent 74ca290fe6
commit badd763f86
3 changed files with 7 additions and 7 deletions

View File

@ -191,10 +191,10 @@ void test_swarm(int flags)
ses3.remove_torrent(tor3, lt::session::delete_files);
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)
{
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;
break;
@ -216,7 +216,7 @@ void test_swarm(int flags)
{
a = ses1.pop_alert();
std::cerr << ret->message() << std::endl;
start = aux::time_now();
start = clock_type::now();
}
// this allows shutting down the sessions in parallel

View File

@ -46,7 +46,7 @@ int test_main()
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)
{
b.incoming(spammer, now);

View File

@ -678,12 +678,12 @@ void test_fastresume(std::string const& test_path)
torrent_handle h = ses.add_torrent(p, ec);
std::auto_ptr<alert> a = ses.pop_alert();
time_point end = aux::time_now() + seconds(20);
while (aux::time_now() < end
time_point end = clock_type::now() + seconds(20);
while (clock_type::now() < end
&& (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;
break;