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

Function coroutine_using_async_ops_3

test/spawn.cpp:432–512  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

430}
431
432int coroutine_using_async_ops_3(boost::asio::yield_context yield)
433{
434 using namespace archetypes;
435
436 try
437 {
438 int i;
439 double d;
440 char c;
441 std::tie(i, d, c) = async_op_3(yield);
442 BOOST_ASIO_CHECK(i == 42);
443 BOOST_ASIO_CHECK(d == 2.0);
444 BOOST_ASIO_CHECK(c == 'a');
445 }
446 catch (...)
447 {
448 BOOST_ASIO_CHECK(false);
449 }
450
451 try
452 {
453 int i;
454 double d;
455 char c;
456 std::tie(i, d, c) = async_op_ec_3(true, yield);
457 BOOST_ASIO_CHECK(i == 42);
458 BOOST_ASIO_CHECK(d == 2.0);
459 BOOST_ASIO_CHECK(c == 'a');
460 }
461 catch (...)
462 {
463 BOOST_ASIO_CHECK(false);
464 }
465
466 try
467 {
468 std::tuple<int, double, char> t = async_op_ec_3(false, yield);
469 BOOST_ASIO_CHECK(false);
470 (void)t;
471 }
472 catch (boost::system::system_error& e)
473 {
474 BOOST_ASIO_CHECK(e.code() == boost::asio::error::operation_aborted);
475 }
476 catch (...)
477 {
478 BOOST_ASIO_CHECK(false);
479 }
480
481 try
482 {
483 int i;
484 double d;
485 char c;
486 std::tie(i, d, c) = async_op_ex_3(true, yield);
487 BOOST_ASIO_CHECK(i == 42);
488 BOOST_ASIO_CHECK(d == 2.0);
489 BOOST_ASIO_CHECK(c == 'a');

Callers

nothing calls this directly

Calls 5

async_op_3Function · 0.85
async_op_ec_3Function · 0.85
async_op_ex_3Function · 0.85
stringFunction · 0.85
codeMethod · 0.80

Tested by

no test coverage detected