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

Function any_executor_nothrow_construction_test

test/execution/any_executor.cpp:433–763  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

431}
432
433void any_executor_nothrow_construction_test()
434{
435 typedef execution::any_executor<> ex_no_props_t;
436
437 typedef execution::any_executor<
438 execution::blocking_t
439 > ex_one_prop_t;
440
441 typedef execution::any_executor<
442 execution::blocking_t,
443 execution::occupancy_t
444 > ex_two_props_t;
445
446 thread_pool pool(1);
447 boost::asio::nullptr_t null_ptr = boost::asio::nullptr_t();
448
449 ex_two_props_t ex_two_props_1;
450
451 BOOST_ASIO_CHECK(ex_two_props_1.target<void>() == 0);
452 BOOST_ASIO_CHECK(ex_two_props_1 == null_ptr);
453
454 ex_two_props_t ex_two_props_2(null_ptr);
455
456 BOOST_ASIO_CHECK(ex_two_props_2.target<void>() == 0);
457 BOOST_ASIO_CHECK(ex_two_props_2 == null_ptr);
458 BOOST_ASIO_CHECK(ex_two_props_2 == ex_two_props_1);
459
460 ex_two_props_t ex_two_props_3(std::nothrow, pool.executor());
461
462 BOOST_ASIO_CHECK(ex_two_props_3.target<void>() != 0);
463 BOOST_ASIO_CHECK(ex_two_props_3 != null_ptr);
464 BOOST_ASIO_CHECK(ex_two_props_3 != ex_two_props_1);
465
466 ex_two_props_t ex_two_props_4(std::nothrow, ex_two_props_1);
467
468 BOOST_ASIO_CHECK(ex_two_props_4.target<void>() == 0);
469 BOOST_ASIO_CHECK(ex_two_props_4 == null_ptr);
470 BOOST_ASIO_CHECK(ex_two_props_4 == ex_two_props_1);
471
472 ex_two_props_t ex_two_props_5(std::nothrow, ex_two_props_3);
473
474 BOOST_ASIO_CHECK(ex_two_props_5.target<void>() != 0);
475 BOOST_ASIO_CHECK(ex_two_props_5 != null_ptr);
476 BOOST_ASIO_CHECK(ex_two_props_5 == ex_two_props_3);
477
478 ex_two_props_t ex_two_props_6(std::nothrow, fat_executor(1));
479
480 BOOST_ASIO_CHECK(ex_two_props_6.target<void>() != 0);
481 BOOST_ASIO_CHECK(ex_two_props_6 != null_ptr);
482 BOOST_ASIO_CHECK(ex_two_props_6 != ex_two_props_1);
483
484 ex_two_props_t ex_two_props_7(std::nothrow, fat_executor(1));
485
486 BOOST_ASIO_CHECK(ex_two_props_7.target<void>() != 0);
487 BOOST_ASIO_CHECK(ex_two_props_7 != null_ptr);
488 BOOST_ASIO_CHECK(ex_two_props_7 != ex_two_props_1);
489 BOOST_ASIO_CHECK(ex_two_props_7 == ex_two_props_6);
490

Callers

nothing calls this directly

Calls 2

fat_executorClass · 0.70
executorMethod · 0.45

Tested by

no test coverage detected