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

Function any_completion_executor_swap_test

test/any_completion_executor.cpp:369–392  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

367}
368
369void any_completion_executor_swap_test()
370{
371 thread_pool pool1(1);
372 thread_pool pool2(1);
373
374 boost::asio::any_completion_executor ex1(pool1.executor());
375 boost::asio::any_completion_executor ex2(pool2.executor());
376
377 boost::asio::any_completion_executor ex3(ex1);
378 boost::asio::any_completion_executor ex4(ex2);
379
380 BOOST_ASIO_CHECK(ex3 == ex1);
381 BOOST_ASIO_CHECK(ex4 == ex2);
382
383 ex3.swap(ex4);
384
385 BOOST_ASIO_CHECK(ex3 == ex2);
386 BOOST_ASIO_CHECK(ex4 == ex1);
387
388 execution::swap(ex3, ex4);
389
390 BOOST_ASIO_CHECK(ex3 == ex1);
391 BOOST_ASIO_CHECK(ex4 == ex2);
392}
393
394void any_completion_executor_query_test()
395{

Callers

nothing calls this directly

Calls 3

swapFunction · 0.85
executorMethod · 0.45
swapMethod · 0.45

Tested by

no test coverage detected