| 33 | } |
| 34 | |
| 35 | void bind_executor_to_function_object_test() |
| 36 | { |
| 37 | io_context ioc1; |
| 38 | io_context ioc2; |
| 39 | |
| 40 | int count = 0; |
| 41 | |
| 42 | timer t(ioc1, chronons::seconds(1)); |
| 43 | t.async_wait( |
| 44 | bind_executor( |
| 45 | ioc2.get_executor(), |
| 46 | bindns::bind(&increment, &count))); |
| 47 | |
| 48 | ioc1.run(); |
| 49 | |
| 50 | BOOST_ASIO_CHECK(count == 0); |
| 51 | |
| 52 | ioc2.run(); |
| 53 | |
| 54 | BOOST_ASIO_CHECK(count == 1); |
| 55 | |
| 56 | t.async_wait( |
| 57 | bind_executor( |
| 58 | ioc2.get_executor(), |
| 59 | bind_executor( |
| 60 | boost::asio::inline_executor(), |
| 61 | bindns::bind(&increment, &count)))); |
| 62 | |
| 63 | ioc1.restart(); |
| 64 | ioc1.run(); |
| 65 | |
| 66 | BOOST_ASIO_CHECK(count == 1); |
| 67 | |
| 68 | ioc2.restart(); |
| 69 | ioc2.run(); |
| 70 | |
| 71 | BOOST_ASIO_CHECK(count == 2); |
| 72 | } |
| 73 | |
| 74 | struct incrementer_token_v1 |
| 75 | { |
nothing calls this directly
no test coverage detected