]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/leaf/test/context_activator_test.cpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / libs / leaf / test / context_activator_test.cpp
index 352da4d8f1b1648a45534b38e381ff5b18e86017..5639c067b1882a0248891c24edb4a7fcac5556d3 100644 (file)
@@ -1,11 +1,16 @@
-// Copyright (c) 2018-2020 Emil Dotchevski and Reverge Studios, Inc.
+// Copyright 2018-2022 Emil Dotchevski and Reverge Studios, Inc.
 
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
-#include <boost/leaf/context.hpp>
-#include <boost/leaf/handle_errors.hpp>
-#include <boost/leaf/result.hpp>
+#ifdef BOOST_LEAF_TEST_SINGLE_HEADER
+#   include "leaf.hpp"
+#else
+#   include <boost/leaf/context.hpp>
+#   include <boost/leaf/handle_errors.hpp>
+#   include <boost/leaf/result.hpp>
+#endif
+
 #include "lightweight_test.hpp"
 
 namespace leaf = boost::leaf;
@@ -40,9 +45,12 @@ int main()
         [&]
         {
             auto ctx = leaf::make_context(error_handlers);
-            auto active_context = activate_context(ctx);
-            auto r = f(ctx);
-            ctx.propagate();
+            leaf::result<int> r;
+            {
+                auto active_context = activate_context(ctx);
+                r = f(ctx);
+            }
+            ctx.propagate(r.error());
             return r;
         },
         error_handlers );