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

Function main

test/ctx_remote_handle_all_test.cpp:31–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29}
30
31int main()
32{
33 auto handlers = std::make_tuple(
34 []( info<1> x )
35 {
36 BOOST_TEST_EQ(x.value, 1);
37 return 1;
38 },
39 []( leaf::diagnostic_details const & info )
40 {
41 std::cout << info;
42 return 2;
43 } );
44
45 auto ctx = leaf::make_context(handlers);
46
47 {
48 leaf::result<int> r1 = f(ctx);
49 BOOST_TEST(!r1);
50
51 int r2 = ctx.handle_error<int>(
52 r1.error(),
53 std::move(handlers));
54 BOOST_TEST_EQ(r2, 1);
55 }
56
57 return boost::report_errors();
58}

Callers

nothing calls this directly

Calls 2

report_errorsFunction · 0.85
fFunction · 0.70

Tested by

no test coverage detected