| 28 | } |
| 29 | |
| 30 | int main() |
| 31 | { |
| 32 | auto error_handlers = std::make_tuple( |
| 33 | []( info<1> x ) |
| 34 | { |
| 35 | BOOST_TEST_EQ(x.value, 1); |
| 36 | return 1; |
| 37 | }, |
| 38 | [] |
| 39 | { |
| 40 | return 2; |
| 41 | } ); |
| 42 | |
| 43 | int r = leaf::try_handle_all( |
| 44 | [&] |
| 45 | { |
| 46 | auto ctx = leaf::make_context(error_handlers); |
| 47 | leaf::result<int> r1; |
| 48 | { |
| 49 | auto active_context = activate_context(ctx); |
| 50 | r1 = f(ctx); |
| 51 | } |
| 52 | ctx.unload(r1.error()); |
| 53 | return r1; |
| 54 | }, |
| 55 | error_handlers ); |
| 56 | BOOST_TEST_EQ(r, 1); |
| 57 | |
| 58 | return boost::report_errors(); |
| 59 | } |
nothing calls this directly
no test coverage detected