| 117 | |
| 118 | template<typename TC> |
| 119 | void cancellation() |
| 120 | { |
| 121 | ceph::timer<TC> timer; |
| 122 | { |
| 123 | std::promise<void> p; |
| 124 | auto f = p.get_future(); |
| 125 | auto e = timer.add_event(100s, Destructo(std::move(p))); |
| 126 | EXPECT_TRUE(timer.cancel_event(e)); |
| 127 | } |
| 128 | { |
| 129 | std::promise<void> p; |
| 130 | auto f = p.get_future(); |
| 131 | auto e = timer.add_event(1s, [p = std::move(p)]() mutable { |
| 132 | p.set_value(); |
| 133 | }); |
| 134 | f.get(); |
| 135 | EXPECT_FALSE(timer.cancel_event(e)); |
| 136 | } |
| 137 | } |
| 138 | |
| 139 | template<typename TC> |
| 140 | void tick(ceph::timer<TC>* t, |
nothing calls this directly
no test coverage detected