| 26 | namespace bindns = std; |
| 27 | |
| 28 | void context_as_executor_query_test() |
| 29 | { |
| 30 | static_thread_pool pool(1); |
| 31 | |
| 32 | BOOST_ASIO_CHECK( |
| 33 | &boost::asio::query(pool.executor(), |
| 34 | execution::context_as_t<static_thread_pool&>()) |
| 35 | == &pool); |
| 36 | |
| 37 | execution::any_executor< |
| 38 | execution::context_as_t<static_thread_pool&> |
| 39 | > ex1 = pool.executor(); |
| 40 | |
| 41 | BOOST_ASIO_CHECK( |
| 42 | &boost::asio::query(ex1, |
| 43 | execution::context_as_t<static_thread_pool&>()) |
| 44 | == &pool); |
| 45 | |
| 46 | BOOST_ASIO_CHECK( |
| 47 | &boost::asio::query(ex1, execution::context) |
| 48 | == &pool); |
| 49 | |
| 50 | BOOST_ASIO_CHECK( |
| 51 | &boost::asio::query(pool.executor(), |
| 52 | execution::context_as_t<const static_thread_pool&>()) |
| 53 | == &pool); |
| 54 | |
| 55 | execution::any_executor< |
| 56 | execution::context_as_t<const static_thread_pool&> |
| 57 | > ex2 = pool.executor(); |
| 58 | |
| 59 | BOOST_ASIO_CHECK( |
| 60 | &boost::asio::query(ex2, |
| 61 | execution::context_as_t<const static_thread_pool&>()) |
| 62 | == &pool); |
| 63 | |
| 64 | BOOST_ASIO_CHECK( |
| 65 | &boost::asio::query(ex2, execution::context) |
| 66 | == &pool); |
| 67 | |
| 68 | io_context io_ctx; |
| 69 | |
| 70 | BOOST_ASIO_CHECK( |
| 71 | &boost::asio::query(io_ctx.get_executor(), |
| 72 | execution::context_as_t<io_context&>()) |
| 73 | == &io_ctx); |
| 74 | |
| 75 | execution::any_executor< |
| 76 | execution::context_as_t<io_context&> |
| 77 | > ex3 = io_ctx.get_executor(); |
| 78 | |
| 79 | BOOST_ASIO_CHECK( |
| 80 | &boost::asio::query(ex3, |
| 81 | execution::context_as_t<io_context&>()) |
| 82 | == &io_ctx); |
| 83 | |
| 84 | BOOST_ASIO_CHECK( |
| 85 | &boost::asio::query(ex3, execution::context) |
nothing calls this directly
no test coverage detected