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

Function symmetrical_test

test/experimental/coro/simple_test.cpp:215–250  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

213}
214
215boost::asio::awaitable<void> symmetrical_test()
216{
217 auto g = symmetrical_test_impl(co_await boost::asio::this_coro::executor);
218
219 BOOST_ASIO_CHECK(g.is_open());
220
221 BOOST_ASIO_CHECK(0 == (co_await g.async_resume(0,
222 boost::asio::use_awaitable)).value_or(-1));
223
224 BOOST_ASIO_CHECK(1 == (co_await g.async_resume(1,
225 boost::asio::use_awaitable)).value_or(-1));
226
227 BOOST_ASIO_CHECK(3 == (co_await g.async_resume(2,
228 boost::asio::use_awaitable)).value_or(-1));
229
230 BOOST_ASIO_CHECK(6 == (co_await g.async_resume(3,
231 boost::asio::use_awaitable)).value_or(-1));
232
233 BOOST_ASIO_CHECK(10 == (co_await g.async_resume(4,
234 boost::asio::use_awaitable)).value_or(-1));
235
236 BOOST_ASIO_CHECK(15 == (co_await g.async_resume(5,
237 boost::asio::use_awaitable)).value_or(-1));
238
239 BOOST_ASIO_CHECK(21 == (co_await g.async_resume(6,
240 boost::asio::use_awaitable)).value_or(-1));
241
242 BOOST_ASIO_CHECK(28 == (co_await g.async_resume(7,
243 boost::asio::use_awaitable)).value_or(-1));
244
245 BOOST_ASIO_CHECK(36 == (co_await g.async_resume(8,
246 boost::asio::use_awaitable)).value_or(-1));
247
248 BOOST_ASIO_CHECK(45 == (co_await g.async_resume(9,
249 boost::asio::use_awaitable)).value_or(-1));
250}
251
252void run_symmetrical_test()
253{

Callers

nothing calls this directly

Calls 3

symmetrical_test_implFunction · 0.85
is_openMethod · 0.45
async_resumeMethod · 0.45

Tested by

no test coverage detected