]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/leaf/test/preload_nested_success_exception_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 #include <boost/leaf/config.hpp>
8 #ifdef BOOST_LEAF_NO_EXCEPTIONS
14 std::cout
<< "Unit test not applicable." << std::endl
;
20 #ifdef BOOST_LEAF_TEST_SINGLE_HEADER
23 # include <boost/leaf/on_error.hpp>
24 # include <boost/leaf/handle_errors.hpp>
27 #include "lightweight_test.hpp"
29 namespace leaf
= boost::leaf
;
31 struct info
{ int value
; };
35 auto load
= leaf::on_error( info
{1} );
40 throw std::exception();
45 auto load
= leaf::on_error( info
{2} );
52 int r
= leaf::try_catch(
60 BOOST_TEST_EQ(x
.value
, 2);
69 return boost::report_errors();