| 514 | } |
| 515 | |
| 516 | void partial_cancel_at_timer_test() |
| 517 | { |
| 518 | io_context ioc; |
| 519 | steady_timer cancellation_timer(ioc); |
| 520 | int count = 0; |
| 521 | |
| 522 | steady_timer t(ioc, chronons::milliseconds(100)); |
| 523 | auto now = steady_timer::clock_type::now(); |
| 524 | t.async_wait(cancel_at(cancellation_timer, now + chronons::seconds(5)))( |
| 525 | incrementer_token_v2(&count)); |
| 526 | |
| 527 | ioc.run(); |
| 528 | |
| 529 | BOOST_ASIO_CHECK(count == 0); |
| 530 | |
| 531 | t.expires_after(chronons::seconds(5)); |
| 532 | now = steady_timer::clock_type::now(); |
| 533 | t.async_wait( |
| 534 | cancel_at(cancellation_timer, now + chronons::milliseconds(100)))( |
| 535 | incrementer_token_v2(&count)); |
| 536 | |
| 537 | ioc.restart(); |
| 538 | ioc.run(); |
| 539 | |
| 540 | BOOST_ASIO_CHECK(count == 1); |
| 541 | } |
| 542 | |
| 543 | BOOST_ASIO_TEST_SUITE |
| 544 | ( |
nothing calls this directly
no test coverage detected