| 812 | } |
| 813 | |
| 814 | void test_async_connect_range_cond() |
| 815 | { |
| 816 | connection_sink sink; |
| 817 | boost::asio::io_context io_context; |
| 818 | boost::asio::ip::tcp::socket socket(io_context); |
| 819 | std::vector<boost::asio::ip::tcp::endpoint> endpoints; |
| 820 | boost::asio::ip::tcp::endpoint result; |
| 821 | boost::system::error_code ec; |
| 822 | |
| 823 | boost::asio::async_connect(socket, endpoints, true_cond_1, |
| 824 | bindns::bind(range_handler, _1, _2, &ec, &result)); |
| 825 | io_context.restart(); |
| 826 | io_context.run(); |
| 827 | BOOST_ASIO_CHECK(result == boost::asio::ip::tcp::endpoint()); |
| 828 | BOOST_ASIO_CHECK(ec == boost::asio::error::not_found); |
| 829 | |
| 830 | boost::asio::async_connect(socket, endpoints, true_cond_2(), |
| 831 | bindns::bind(range_handler, _1, _2, &ec, &result)); |
| 832 | io_context.restart(); |
| 833 | io_context.run(); |
| 834 | BOOST_ASIO_CHECK(result == boost::asio::ip::tcp::endpoint()); |
| 835 | BOOST_ASIO_CHECK(ec == boost::asio::error::not_found); |
| 836 | |
| 837 | boost::asio::async_connect(socket, endpoints, legacy_true_cond_1, |
| 838 | bindns::bind(range_handler, _1, _2, &ec, &result)); |
| 839 | io_context.restart(); |
| 840 | io_context.run(); |
| 841 | BOOST_ASIO_CHECK(result == boost::asio::ip::tcp::endpoint()); |
| 842 | BOOST_ASIO_CHECK(ec == boost::asio::error::not_found); |
| 843 | |
| 844 | boost::asio::async_connect(socket, endpoints, legacy_true_cond_2(), |
| 845 | bindns::bind(range_handler, _1, _2, &ec, &result)); |
| 846 | io_context.restart(); |
| 847 | io_context.run(); |
| 848 | BOOST_ASIO_CHECK(result == boost::asio::ip::tcp::endpoint()); |
| 849 | BOOST_ASIO_CHECK(ec == boost::asio::error::not_found); |
| 850 | |
| 851 | boost::asio::async_connect(socket, endpoints, false_cond, |
| 852 | bindns::bind(range_handler, _1, _2, &ec, &result)); |
| 853 | io_context.restart(); |
| 854 | io_context.run(); |
| 855 | BOOST_ASIO_CHECK(result == boost::asio::ip::tcp::endpoint()); |
| 856 | BOOST_ASIO_CHECK(ec == boost::asio::error::not_found); |
| 857 | |
| 858 | endpoints.push_back(sink.target_endpoint()); |
| 859 | |
| 860 | boost::asio::async_connect(socket, endpoints, true_cond_1, |
| 861 | bindns::bind(range_handler, _1, _2, &ec, &result)); |
| 862 | io_context.restart(); |
| 863 | io_context.run(); |
| 864 | BOOST_ASIO_CHECK(result == endpoints[0]); |
| 865 | BOOST_ASIO_CHECK(!ec); |
| 866 | |
| 867 | boost::asio::async_connect(socket, endpoints, true_cond_2(), |
| 868 | bindns::bind(range_handler, _1, _2, &ec, &result)); |
| 869 | io_context.restart(); |
| 870 | io_context.run(); |
| 871 | BOOST_ASIO_CHECK(result == endpoints[0]); |
nothing calls this directly
no test coverage detected