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

Function test_connect_range_cond

test/connect.cpp:195–324  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

193}
194
195void test_connect_range_cond()
196{
197 connection_sink sink;
198 boost::asio::io_context io_context;
199 boost::asio::ip::tcp::socket socket(io_context);
200 std::vector<boost::asio::ip::tcp::endpoint> endpoints;
201 boost::asio::ip::tcp::endpoint result;
202
203 try
204 {
205 result = boost::asio::connect(socket, endpoints, true_cond_1);
206 BOOST_ASIO_CHECK(false);
207 }
208 catch (boost::system::system_error& e)
209 {
210 BOOST_ASIO_CHECK(e.code() == boost::asio::error::not_found);
211 }
212
213 try
214 {
215 result = boost::asio::connect(socket, endpoints, true_cond_2());
216 BOOST_ASIO_CHECK(false);
217 }
218 catch (boost::system::system_error& e)
219 {
220 BOOST_ASIO_CHECK(e.code() == boost::asio::error::not_found);
221 }
222
223 try
224 {
225 result = boost::asio::connect(socket, endpoints, legacy_true_cond_1);
226 BOOST_ASIO_CHECK(false);
227 }
228 catch (boost::system::system_error& e)
229 {
230 BOOST_ASIO_CHECK(e.code() == boost::asio::error::not_found);
231 }
232
233 try
234 {
235 result = boost::asio::connect(socket, endpoints, legacy_true_cond_2());
236 BOOST_ASIO_CHECK(false);
237 }
238 catch (boost::system::system_error& e)
239 {
240 BOOST_ASIO_CHECK(e.code() == boost::asio::error::not_found);
241 }
242
243 try
244 {
245 result = boost::asio::connect(socket, endpoints, false_cond);
246 BOOST_ASIO_CHECK(false);
247 }
248 catch (boost::system::system_error& e)
249 {
250 BOOST_ASIO_CHECK(e.code() == boost::asio::error::not_found);
251 }
252

Callers

nothing calls this directly

Calls 8

true_cond_2Class · 0.85
legacy_true_cond_2Class · 0.85
codeMethod · 0.80
target_endpointMethod · 0.80
insertMethod · 0.80
connectFunction · 0.50
endpointClass · 0.50
beginMethod · 0.45

Tested by

no test coverage detected