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

Function any_executor_construction_test

test/execution/any_executor.cpp:122–431  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120}
121
122void any_executor_construction_test()
123{
124 typedef execution::any_executor<> ex_no_props_t;
125
126 typedef execution::any_executor<
127 execution::blocking_t
128 > ex_one_prop_t;
129
130 typedef execution::any_executor<
131 execution::blocking_t,
132 execution::occupancy_t
133 > ex_two_props_t;
134
135 thread_pool pool(1);
136 boost::asio::nullptr_t null_ptr = boost::asio::nullptr_t();
137
138 ex_two_props_t ex_two_props_1;
139
140 BOOST_ASIO_CHECK(ex_two_props_1.target<void>() == 0);
141 BOOST_ASIO_CHECK(ex_two_props_1 == null_ptr);
142
143 ex_two_props_t ex_two_props_2(null_ptr);
144
145 BOOST_ASIO_CHECK(ex_two_props_2.target<void>() == 0);
146 BOOST_ASIO_CHECK(ex_two_props_2 == null_ptr);
147 BOOST_ASIO_CHECK(ex_two_props_2 == ex_two_props_1);
148
149 ex_two_props_t ex_two_props_3(pool.executor());
150
151 BOOST_ASIO_CHECK(ex_two_props_3.target<void>() != 0);
152 BOOST_ASIO_CHECK(ex_two_props_3 != null_ptr);
153 BOOST_ASIO_CHECK(ex_two_props_3 != ex_two_props_1);
154
155 ex_two_props_t ex_two_props_4(ex_two_props_1);
156
157 BOOST_ASIO_CHECK(ex_two_props_4.target<void>() == 0);
158 BOOST_ASIO_CHECK(ex_two_props_4 == null_ptr);
159 BOOST_ASIO_CHECK(ex_two_props_4 == ex_two_props_1);
160
161 ex_two_props_t ex_two_props_5(ex_two_props_3);
162
163 BOOST_ASIO_CHECK(ex_two_props_5.target<void>() != 0);
164 BOOST_ASIO_CHECK(ex_two_props_5 != null_ptr);
165 BOOST_ASIO_CHECK(ex_two_props_5 == ex_two_props_3);
166
167 ex_two_props_t ex_two_props_6 = fat_executor(1);
168
169 BOOST_ASIO_CHECK(ex_two_props_6.target<void>() != 0);
170 BOOST_ASIO_CHECK(ex_two_props_6 != null_ptr);
171 BOOST_ASIO_CHECK(ex_two_props_6 != ex_two_props_1);
172
173 ex_two_props_t ex_two_props_7 = fat_executor(1);
174
175 BOOST_ASIO_CHECK(ex_two_props_7.target<void>() != 0);
176 BOOST_ASIO_CHECK(ex_two_props_7 != null_ptr);
177 BOOST_ASIO_CHECK(ex_two_props_7 != ex_two_props_1);
178 BOOST_ASIO_CHECK(ex_two_props_7 == ex_two_props_6);
179

Callers

nothing calls this directly

Calls 2

fat_executorClass · 0.70
executorMethod · 0.45

Tested by

no test coverage detected