| 2616 | } |
| 2617 | |
| 2618 | void test_4_arg_const_buffer_async_write() |
| 2619 | { |
| 2620 | namespace bindns = std; |
| 2621 | using bindns::placeholders::_1; |
| 2622 | using bindns::placeholders::_2; |
| 2623 | |
| 2624 | boost::asio::io_context ioc; |
| 2625 | test_stream s(ioc); |
| 2626 | boost::asio::const_buffer buffers |
| 2627 | = boost::asio::buffer(write_data, sizeof(write_data)); |
| 2628 | |
| 2629 | s.reset(); |
| 2630 | bool called = false; |
| 2631 | boost::asio::async_write(s, buffers, boost::asio::transfer_all(), |
| 2632 | bindns::bind(async_write_handler, |
| 2633 | _1, _2, sizeof(write_data), &called)); |
| 2634 | ioc.restart(); |
| 2635 | ioc.run(); |
| 2636 | BOOST_ASIO_CHECK(called); |
| 2637 | BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data))); |
| 2638 | |
| 2639 | s.reset(); |
| 2640 | s.next_write_length(1); |
| 2641 | called = false; |
| 2642 | boost::asio::async_write(s, buffers, boost::asio::transfer_all(), |
| 2643 | bindns::bind(async_write_handler, |
| 2644 | _1, _2, sizeof(write_data), &called)); |
| 2645 | ioc.restart(); |
| 2646 | ioc.run(); |
| 2647 | BOOST_ASIO_CHECK(called); |
| 2648 | BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data))); |
| 2649 | |
| 2650 | s.reset(); |
| 2651 | s.next_write_length(10); |
| 2652 | called = false; |
| 2653 | boost::asio::async_write(s, buffers, boost::asio::transfer_all(), |
| 2654 | bindns::bind(async_write_handler, |
| 2655 | _1, _2, sizeof(write_data), &called)); |
| 2656 | ioc.restart(); |
| 2657 | ioc.run(); |
| 2658 | BOOST_ASIO_CHECK(called); |
| 2659 | BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data))); |
| 2660 | |
| 2661 | s.reset(); |
| 2662 | called = false; |
| 2663 | boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(1), |
| 2664 | bindns::bind(async_write_handler, |
| 2665 | _1, _2, sizeof(write_data), &called)); |
| 2666 | ioc.restart(); |
| 2667 | ioc.run(); |
| 2668 | BOOST_ASIO_CHECK(called); |
| 2669 | BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data))); |
| 2670 | |
| 2671 | s.reset(); |
| 2672 | s.next_write_length(1); |
| 2673 | called = false; |
| 2674 | boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(1), |
| 2675 | bindns::bind(async_write_handler, |
nothing calls this directly
no test coverage detected