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

Function test_connect_range_ec

test/connect.cpp:163–193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161}
162
163void 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
195void test_connect_range_cond()
196{

Callers

nothing calls this directly

Calls 5

target_endpointMethod · 0.80
insertMethod · 0.80
connectFunction · 0.50
endpointClass · 0.50
beginMethod · 0.45

Tested by

no test coverage detected