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

Function main

test/ctx_remote_handle_some_test.cpp:30–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

report_errorsFunction · 0.85
fFunction · 0.70
valueMethod · 0.45

Tested by

no test coverage detected