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

Function consign_test

test/consign.cpp:25–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23#include "unit_test.hpp"
24
25void consign_test()
26{
27 boost::asio::io_context io1;
28 boost::asio::io_context io2;
29 boost::asio::system_timer timer1(io1);
30 int count = 0;
31
32 timer1.expires_after(boost::asio::chrono::seconds(0));
33 timer1.async_wait(
34 boost::asio::consign(
35 boost::asio::bind_executor(io2.get_executor(),
36 [&count](boost::system::error_code)
37 {
38 ++count;
39 }), 123, 321));
40
41 BOOST_ASIO_CHECK(count == 0);
42
43 io1.run();
44
45 BOOST_ASIO_CHECK(count == 0);
46
47 io2.run();
48
49 BOOST_ASIO_CHECK(count == 1);
50}
51
52BOOST_ASIO_TEST_SUITE
53(

Callers

nothing calls this directly

Calls 4

expires_afterMethod · 0.45
async_waitMethod · 0.45
get_executorMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected