]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/thread/test/sync/futures/promise/set_value_void_pass.cpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / thread / test / sync / futures / promise / set_value_void_pass.cpp
index d1f6357afdd98895759c283d3bb39e9aa6983c79..7c11d5b666231a9f01c2632a89a7c62d3ea88370 100644 (file)
@@ -58,7 +58,27 @@ int main()
       BOOST_TEST(false);
     }
   }
-
+  {
+    typedef void T;
+    boost::promise<T> p;
+    boost::future<T> f = p.get_future();
+    p.set_value_deferred();
+    p.notify_deferred();
+    f.get();
+    try
+    {
+      p.set_value();
+      BOOST_TEST(false);
+    }
+    catch (const boost::future_error& e)
+    {
+      BOOST_TEST(e.code() == boost::system::make_error_code(boost::future_errc::promise_already_satisfied));
+    }
+    catch (...)
+    {
+      BOOST_TEST(false);
+    }
+  }
   return boost::report_errors();
 }