| 174 | } |
| 175 | |
| 176 | void partial_bind_executor_test() |
| 177 | { |
| 178 | io_context ioc1; |
| 179 | io_context ioc2; |
| 180 | |
| 181 | int count = 0; |
| 182 | |
| 183 | timer t(ioc1, chronons::seconds(1)); |
| 184 | t.async_wait(bind_executor(ioc2.get_executor()))( |
| 185 | bindns::bind(&increment, &count)); |
| 186 | |
| 187 | ioc1.run(); |
| 188 | |
| 189 | BOOST_ASIO_CHECK(count == 0); |
| 190 | |
| 191 | ioc2.run(); |
| 192 | |
| 193 | BOOST_ASIO_CHECK(count == 1); |
| 194 | |
| 195 | t.expires_after(chronons::seconds(1)); |
| 196 | t.async_wait()( |
| 197 | bind_executor(ioc2.get_executor()))( |
| 198 | incrementer_token_v2(&count)); |
| 199 | |
| 200 | ioc1.restart(); |
| 201 | ioc1.run(); |
| 202 | |
| 203 | BOOST_ASIO_CHECK(count == 1); |
| 204 | |
| 205 | ioc2.restart(); |
| 206 | ioc2.run(); |
| 207 | |
| 208 | BOOST_ASIO_CHECK(count == 2); |
| 209 | } |
| 210 | |
| 211 | BOOST_ASIO_TEST_SUITE |
| 212 | ( |
nothing calls this directly
no test coverage detected