| 227 | } |
| 228 | |
| 229 | void deadline_timer_cancel_test() |
| 230 | { |
| 231 | static boost::asio::io_context io_context; |
| 232 | struct timer |
| 233 | { |
| 234 | boost::asio::deadline_timer t; |
| 235 | timer() : t(io_context) { t.expires_at(boost::posix_time::pos_infin); } |
| 236 | } timers[50]; |
| 237 | |
| 238 | timers[2].t.async_wait(&timer_handler); |
| 239 | timers[41].t.async_wait(&timer_handler); |
| 240 | for (int i = 10; i < 20; ++i) |
| 241 | timers[i].t.async_wait(&timer_handler); |
| 242 | |
| 243 | BOOST_ASIO_CHECK(timers[2].t.cancel() == 1); |
| 244 | BOOST_ASIO_CHECK(timers[41].t.cancel() == 1); |
| 245 | for (int i = 10; i < 20; ++i) |
| 246 | BOOST_ASIO_CHECK(timers[i].t.cancel() == 1); |
| 247 | } |
| 248 | |
| 249 | struct custom_allocation_timer_handler |
| 250 | { |
nothing calls this directly
no test coverage detected