MCPcopy Create free account
hub / github.com/boostorg/asio / use_future_0_test

Function use_future_0_test

test/use_future.cpp:26–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24#include "archetypes/async_ops.hpp"
25
26void use_future_0_test()
27{
28 using boost::asio::use_future;
29 using namespace archetypes;
30
31 std::future<void> f;
32
33 f = async_op_0(use_future);
34 try
35 {
36 f.get();
37 }
38 catch (...)
39 {
40 BOOST_ASIO_CHECK(false);
41 }
42
43 f = async_op_ec_0(true, use_future);
44 try
45 {
46 f.get();
47 }
48 catch (...)
49 {
50 BOOST_ASIO_CHECK(false);
51 }
52
53 f = async_op_ec_0(false, use_future);
54 try
55 {
56 f.get();
57 BOOST_ASIO_CHECK(false);
58 }
59 catch (boost::system::system_error& e)
60 {
61 BOOST_ASIO_CHECK(e.code() == boost::asio::error::operation_aborted);
62 }
63 catch (...)
64 {
65 BOOST_ASIO_CHECK(false);
66 }
67
68 f = async_op_ex_0(true, use_future);
69 try
70 {
71 f.get();
72 }
73 catch (...)
74 {
75 BOOST_ASIO_CHECK(false);
76 }
77
78 f = async_op_ex_0(false, use_future);
79 try
80 {
81 f.get();
82 BOOST_ASIO_CHECK(false);
83 }

Callers

nothing calls this directly

Calls 6

async_op_0Function · 0.85
async_op_ec_0Function · 0.85
async_op_ex_0Function · 0.85
stringFunction · 0.85
codeMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected