| 324 | } |
| 325 | |
| 326 | void test_connect_range_cond_ec() |
| 327 | { |
| 328 | connection_sink sink; |
| 329 | boost::asio::io_context io_context; |
| 330 | boost::asio::ip::tcp::socket socket(io_context); |
| 331 | std::vector<boost::asio::ip::tcp::endpoint> endpoints; |
| 332 | boost::asio::ip::tcp::endpoint result; |
| 333 | boost::system::error_code ec; |
| 334 | |
| 335 | result = boost::asio::connect(socket, endpoints, true_cond_1, ec); |
| 336 | BOOST_ASIO_CHECK(result == boost::asio::ip::tcp::endpoint()); |
| 337 | BOOST_ASIO_CHECK(ec == boost::asio::error::not_found); |
| 338 | |
| 339 | result = boost::asio::connect(socket, endpoints, true_cond_2(), ec); |
| 340 | BOOST_ASIO_CHECK(result == boost::asio::ip::tcp::endpoint()); |
| 341 | BOOST_ASIO_CHECK(ec == boost::asio::error::not_found); |
| 342 | |
| 343 | result = boost::asio::connect(socket, endpoints, legacy_true_cond_1, ec); |
| 344 | BOOST_ASIO_CHECK(result == boost::asio::ip::tcp::endpoint()); |
| 345 | BOOST_ASIO_CHECK(ec == boost::asio::error::not_found); |
| 346 | |
| 347 | result = boost::asio::connect(socket, endpoints, legacy_true_cond_2(), ec); |
| 348 | BOOST_ASIO_CHECK(result == boost::asio::ip::tcp::endpoint()); |
| 349 | BOOST_ASIO_CHECK(ec == boost::asio::error::not_found); |
| 350 | |
| 351 | result = boost::asio::connect(socket, endpoints, false_cond, ec); |
| 352 | BOOST_ASIO_CHECK(result == boost::asio::ip::tcp::endpoint()); |
| 353 | BOOST_ASIO_CHECK(ec == boost::asio::error::not_found); |
| 354 | |
| 355 | endpoints.push_back(sink.target_endpoint()); |
| 356 | |
| 357 | result = boost::asio::connect(socket, endpoints, true_cond_1, ec); |
| 358 | BOOST_ASIO_CHECK(result == endpoints[0]); |
| 359 | BOOST_ASIO_CHECK(!ec); |
| 360 | |
| 361 | result = boost::asio::connect(socket, endpoints, true_cond_2(), ec); |
| 362 | BOOST_ASIO_CHECK(result == endpoints[0]); |
| 363 | BOOST_ASIO_CHECK(!ec); |
| 364 | |
| 365 | result = boost::asio::connect(socket, endpoints, legacy_true_cond_1, ec); |
| 366 | BOOST_ASIO_CHECK(result == endpoints[0]); |
| 367 | BOOST_ASIO_CHECK(!ec); |
| 368 | |
| 369 | result = boost::asio::connect(socket, endpoints, legacy_true_cond_2(), ec); |
| 370 | BOOST_ASIO_CHECK(result == endpoints[0]); |
| 371 | BOOST_ASIO_CHECK(!ec); |
| 372 | |
| 373 | result = boost::asio::connect(socket, endpoints, false_cond, ec); |
| 374 | BOOST_ASIO_CHECK(result == boost::asio::ip::tcp::endpoint()); |
| 375 | BOOST_ASIO_CHECK(ec == boost::asio::error::not_found); |
| 376 | |
| 377 | endpoints.push_back(sink.target_endpoint()); |
| 378 | |
| 379 | result = boost::asio::connect(socket, endpoints, true_cond_1, ec); |
| 380 | BOOST_ASIO_CHECK(result == endpoints[0]); |
| 381 | BOOST_ASIO_CHECK(!ec); |
| 382 | |
| 383 | result = boost::asio::connect(socket, endpoints, true_cond_2(), ec); |
nothing calls this directly
no test coverage detected