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

Function any_completion_executor_assignment_test

test/any_completion_executor.cpp:291–367  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

289}
290
291void any_completion_executor_assignment_test()
292{
293 thread_pool pool(1);
294 boost::asio::nullptr_t null_ptr = boost::asio::nullptr_t();
295
296 boost::asio::any_completion_executor ex1;
297
298 boost::asio::any_completion_executor ex2;
299 ex2 = null_ptr;
300
301 BOOST_ASIO_CHECK(ex2.target<void>() == 0);
302
303 boost::asio::any_completion_executor ex3;
304 ex3 = pool.executor();
305
306 BOOST_ASIO_CHECK(ex3.target<void>() != 0);
307
308 boost::asio::any_completion_executor ex4;
309 ex4 = ex1;
310
311 BOOST_ASIO_CHECK(ex4.target<void>() == 0);
312 BOOST_ASIO_CHECK(ex4 == ex1);
313
314 ex4 = ex3;
315
316 BOOST_ASIO_CHECK(ex4.target<void>() != 0);
317 BOOST_ASIO_CHECK(ex4 == ex3);
318
319 boost::asio::any_completion_executor ex5;
320 ex5 = fat_executor(1);
321
322 BOOST_ASIO_CHECK(ex5.target<void>() != 0);
323 BOOST_ASIO_CHECK(ex5 != null_ptr);
324 BOOST_ASIO_CHECK(ex5 != ex1);
325
326 boost::asio::any_completion_executor ex6;
327 ex6 = fat_executor(1);
328
329 BOOST_ASIO_CHECK(ex6.target<void>() != 0);
330 BOOST_ASIO_CHECK(ex6 != null_ptr);
331 BOOST_ASIO_CHECK(ex6 != ex1);
332 BOOST_ASIO_CHECK(ex6 == ex5);
333
334 ex6 = fat_executor(2);
335
336 BOOST_ASIO_CHECK(ex6.target<void>() != 0);
337 BOOST_ASIO_CHECK(ex6 != null_ptr);
338 BOOST_ASIO_CHECK(ex6 != ex1);
339 BOOST_ASIO_CHECK(ex6 != ex5);
340
341 boost::asio::any_completion_executor ex7;
342 ex7 = ex5;
343
344 BOOST_ASIO_CHECK(ex7.target<void>() != 0);
345 BOOST_ASIO_CHECK(ex7 != null_ptr);
346 BOOST_ASIO_CHECK(ex7 != ex1);
347 BOOST_ASIO_CHECK(ex7 == ex5);
348 BOOST_ASIO_CHECK(ex7 != ex6);

Callers

nothing calls this directly

Calls 2

fat_executorClass · 0.70
executorMethod · 0.45

Tested by

no test coverage detected