Skip to content

Commit

Permalink
Merge pull request #2712 from STEllAR-GROUP/fixing_wait_for_1751
Browse files Browse the repository at this point in the history
Fixing wait for 1751
  • Loading branch information
sithhell committed Jun 26, 2017
2 parents 539adfd + e51b330 commit d1898af
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions tests/regressions/lcos/wait_for_1751.cpp
Expand Up @@ -8,6 +8,7 @@

#include <hpx/hpx.hpp>
#include <hpx/hpx_init.hpp>
#include <hpx/util/lightweight_test.hpp>

#include <chrono>
#include <iostream>
Expand All @@ -28,14 +29,12 @@ int hpx_main()
auto f = hpx::async([](){});

if (f.wait_for(std::chrono::seconds(1)) ==
hpx::lcos::future_status::timeout)
hpx::lcos::future_status::timeout)
{
auto now = std::chrono::high_resolution_clock::now();
overall_dif = now - overall_start_time;
std::chrono::duration<double> dif = now - start_time;

std::cout << "Future timed out after "
<< dif.count() << " (" << overall_dif.count() << ") seconds.\n";
HPX_TEST_LTE(1.0, dif.count());
break;
}
else
Expand All @@ -44,16 +43,15 @@ int hpx_main()
}

auto now = std::chrono::high_resolution_clock::now();
overall_dif = now - overall_start_time;
std::chrono::duration<double> dif = now - start_time;
std::cout << "Future took "
<< dif.count() << " (" << overall_dif.count() << ") seconds.\n";
HPX_TEST_LT(dif.count(), 1.0);
}

return hpx::finalize();
}

int main(int argc, char *argv[])
{
return hpx::init(argc, argv);
hpx::init(argc, argv);
return hpx::util::report_errors();
}

0 comments on commit d1898af

Please sign in to comment.