Skip to content
This repository has been archived by the owner on Jun 11, 2022. It is now read-only.

Commit

Permalink
checking if it's just an asio timing problem
Browse files Browse the repository at this point in the history
  • Loading branch information
klemens-morgenstern committed Nov 13, 2018
1 parent 997f10c commit 080f3fb
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions test/async.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,19 +149,21 @@ BOOST_AUTO_TEST_CASE(async_wait_different_contexts, *boost::unit_test::timeout(5

bool exit_called_for_c1 = false;
int exit_code_c1 = 0;
bp::child c1(
master_test_suite().argv[1],
"test", "--exit-code", "1",
ec,
io_context1,
bp::on_exit([&](int exit, const std::error_code& ec_in)
{
BOOST_CHECK(!exit_called_for_c1);
exit_code_c1 = exit; exit_called_for_c1=true;
BOOST_CHECK(!ec_in);
timeout1.cancel();
})
);
bp::child c1;
io_context1.post(
[&]{c1 = bp::child(
master_test_suite().argv[1],
"test", "--exit-code", "1",
ec,
io_context1,
bp::on_exit([&](int exit, const std::error_code& ec_in)
{
BOOST_CHECK(!exit_called_for_c1);
exit_code_c1 = exit; exit_called_for_c1=true;
BOOST_CHECK(!ec_in);
timeout1.cancel();
})
);});
BOOST_REQUIRE(!ec);

bool exit_called_for_c2 = false;
Expand Down

0 comments on commit 080f3fb

Please sign in to comment.