| 161 | } |
| 162 | |
| 163 | void test_connect_range_ec() |
| 164 | { |
| 165 | connection_sink sink; |
| 166 | boost::asio::io_context io_context; |
| 167 | boost::asio::ip::tcp::socket socket(io_context); |
| 168 | std::vector<boost::asio::ip::tcp::endpoint> endpoints; |
| 169 | boost::asio::ip::tcp::endpoint result; |
| 170 | boost::system::error_code ec; |
| 171 | |
| 172 | result = boost::asio::connect(socket, endpoints, ec); |
| 173 | BOOST_ASIO_CHECK(result == boost::asio::ip::tcp::endpoint()); |
| 174 | BOOST_ASIO_CHECK(ec == boost::asio::error::not_found); |
| 175 | |
| 176 | endpoints.push_back(sink.target_endpoint()); |
| 177 | |
| 178 | result = boost::asio::connect(socket, endpoints, ec); |
| 179 | BOOST_ASIO_CHECK(result == endpoints[0]); |
| 180 | BOOST_ASIO_CHECK(!ec); |
| 181 | |
| 182 | endpoints.push_back(sink.target_endpoint()); |
| 183 | |
| 184 | result = boost::asio::connect(socket, endpoints, ec); |
| 185 | BOOST_ASIO_CHECK(result == endpoints[0]); |
| 186 | BOOST_ASIO_CHECK(!ec); |
| 187 | |
| 188 | endpoints.insert(endpoints.begin(), boost::asio::ip::tcp::endpoint()); |
| 189 | |
| 190 | result = boost::asio::connect(socket, endpoints, ec); |
| 191 | BOOST_ASIO_CHECK(result == endpoints[1]); |
| 192 | BOOST_ASIO_CHECK(!ec); |
| 193 | } |
| 194 | |
| 195 | void test_connect_range_cond() |
| 196 | { |
nothing calls this directly
no test coverage detected