MCPcopy Create free account
hub / github.com/boostorg/leaf / main

Function main

test/context_activator_test.cpp:30–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28}
29
30int 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}

Callers

nothing calls this directly

Calls 5

try_handle_allFunction · 0.85
activate_contextFunction · 0.85
report_errorsFunction · 0.85
fFunction · 0.70
unloadMethod · 0.45

Tested by

no test coverage detected