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

Function any_completion_executor_construction_test

test/any_completion_executor.cpp:106–193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104}
105
106void any_completion_executor_construction_test()
107{
108 thread_pool pool(1);
109 boost::asio::nullptr_t null_ptr = boost::asio::nullptr_t();
110
111 boost::asio::any_completion_executor ex1;
112
113 BOOST_ASIO_CHECK(ex1.target<void>() == 0);
114 BOOST_ASIO_CHECK(ex1 == null_ptr);
115
116 boost::asio::any_completion_executor ex2(null_ptr);
117
118 BOOST_ASIO_CHECK(ex2.target<void>() == 0);
119 BOOST_ASIO_CHECK(ex2 == null_ptr);
120 BOOST_ASIO_CHECK(ex2 == ex1);
121
122 boost::asio::any_completion_executor ex3(pool.executor());
123
124 BOOST_ASIO_CHECK(ex3.target<void>() != 0);
125 BOOST_ASIO_CHECK(ex3 != null_ptr);
126 BOOST_ASIO_CHECK(ex3 != ex1);
127
128 boost::asio::any_completion_executor ex4(ex1);
129
130 BOOST_ASIO_CHECK(ex4.target<void>() == 0);
131 BOOST_ASIO_CHECK(ex4 == null_ptr);
132 BOOST_ASIO_CHECK(ex4 == ex1);
133
134 boost::asio::any_completion_executor ex5(ex3);
135
136 BOOST_ASIO_CHECK(ex5.target<void>() != 0);
137 BOOST_ASIO_CHECK(ex5 != null_ptr);
138 BOOST_ASIO_CHECK(ex5 == ex3);
139
140 boost::asio::any_completion_executor ex6 = fat_executor(1);
141
142 BOOST_ASIO_CHECK(ex6.target<void>() != 0);
143 BOOST_ASIO_CHECK(ex6 != null_ptr);
144 BOOST_ASIO_CHECK(ex6 != ex1);
145
146 boost::asio::any_completion_executor ex7 = fat_executor(1);
147
148 BOOST_ASIO_CHECK(ex7.target<void>() != 0);
149 BOOST_ASIO_CHECK(ex7 != null_ptr);
150 BOOST_ASIO_CHECK(ex7 != ex1);
151 BOOST_ASIO_CHECK(ex7 == ex6);
152
153 boost::asio::any_completion_executor ex8 = fat_executor(2);
154
155 BOOST_ASIO_CHECK(ex8.target<void>() != 0);
156 BOOST_ASIO_CHECK(ex8 != null_ptr);
157 BOOST_ASIO_CHECK(ex8 != ex1);
158 BOOST_ASIO_CHECK(ex8 != ex6);
159 BOOST_ASIO_CHECK(ex8 != ex7);
160
161 boost::asio::any_completion_executor ex9(ex6);
162
163 BOOST_ASIO_CHECK(ex9.target<void>() != 0);

Callers

nothing calls this directly

Calls 2

fat_executorClass · 0.70
executorMethod · 0.45

Tested by

no test coverage detected