| 23 | #include "unit_test.hpp" |
| 24 | |
| 25 | void prepend_test() |
| 26 | { |
| 27 | boost::asio::io_context io1; |
| 28 | boost::asio::io_context io2; |
| 29 | boost::asio::system_timer timer1(io1); |
| 30 | int count = 0; |
| 31 | |
| 32 | timer1.expires_after(boost::asio::chrono::seconds(0)); |
| 33 | timer1.async_wait( |
| 34 | boost::asio::prepend( |
| 35 | boost::asio::bind_executor(io2.get_executor(), |
| 36 | [&count](int a, int b, boost::system::error_code) |
| 37 | { |
| 38 | ++count; |
| 39 | BOOST_ASIO_CHECK(a == 123); |
| 40 | BOOST_ASIO_CHECK(b == 321); |
| 41 | }), 123, 321)); |
| 42 | |
| 43 | BOOST_ASIO_CHECK(count == 0); |
| 44 | |
| 45 | io1.run(); |
| 46 | |
| 47 | BOOST_ASIO_CHECK(count == 0); |
| 48 | |
| 49 | io2.run(); |
| 50 | |
| 51 | BOOST_ASIO_CHECK(count == 1); |
| 52 | } |
| 53 | |
| 54 | BOOST_ASIO_TEST_SUITE |
| 55 | ( |
nothing calls this directly
no test coverage detected