| 231 | }; |
| 232 | |
| 233 | void system_timer_cancel_test() |
| 234 | { |
| 235 | static boost::asio::io_context io_context; |
| 236 | struct timer |
| 237 | { |
| 238 | boost::asio::system_timer t; |
| 239 | timer() : t(io_context) |
| 240 | { |
| 241 | t.expires_at((boost::asio::system_timer::time_point::max)()); |
| 242 | } |
| 243 | } timers[50]; |
| 244 | |
| 245 | timers[2].t.async_wait(timer_handler()); |
| 246 | timers[41].t.async_wait(timer_handler()); |
| 247 | for (int i = 10; i < 20; ++i) |
| 248 | timers[i].t.async_wait(timer_handler()); |
| 249 | |
| 250 | BOOST_ASIO_CHECK(timers[2].t.cancel() == 1); |
| 251 | BOOST_ASIO_CHECK(timers[41].t.cancel() == 1); |
| 252 | for (int i = 10; i < 20; ++i) |
| 253 | BOOST_ASIO_CHECK(timers[i].t.cancel() == 1); |
| 254 | } |
| 255 | |
| 256 | struct custom_allocation_timer_handler |
| 257 | { |
nothing calls this directly
no test coverage detected