]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/leaf/test/ctx_remote_handle_all_test.cpp
1 // Copyright 2018-2022 Emil Dotchevski and Reverge Studios, Inc.
3 // Distributed under the Boost Software License, Version 1.0. (See accompanying
4 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 #ifdef BOOST_LEAF_TEST_SINGLE_HEADER
9 # include <boost/leaf/context.hpp>
10 # include <boost/leaf/handle_errors.hpp>
11 # include <boost/leaf/result.hpp>
14 #include "lightweight_test.hpp"
17 namespace leaf
= boost::leaf
;
26 leaf::result
<int> f( Ctx
& ctx
)
28 auto active_context
= activate_context(ctx
);
29 return leaf::new_error( info
<1>{1} );
34 auto handlers
= std::make_tuple(
37 BOOST_TEST(x
.value
==1);
40 []( leaf::verbose_diagnostic_info
const & info
)
46 auto ctx
= leaf::make_context(handlers
);
49 leaf::result
<int> r1
= f(ctx
);
52 int r2
= ctx
.handle_error
<int>(
58 return boost::report_errors();