MCPcopy Create free account
hub / github.com/boostorg/cobalt / CO_TEST_CASE

Function CO_TEST_CASE

test/left_race.cpp:40–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38#if !defined(BOOST_COBALT_NO_SELF_DELETE)
39
40CO_TEST_CASE(variadic)
41{
42 auto exec = co_await asio::this_coro::executor;
43 auto d1 = dummy(exec, std::chrono::milliseconds(100));
44 auto d2 = dummy(exec, std::chrono::milliseconds( 50));
45 auto g = gen(exec);
46 auto c = co_await left_race(d1, d2, dummy(exec, std::chrono::milliseconds(100000)), g);
47 BOOST_CHECK(c.index() == 1u);
48 BOOST_CHECK(boost::variant2::get<1>(c) == 50);
49 BOOST_CHECK(d1);
50 BOOST_CHECK(!d1.ready());
51 BOOST_CHECK( d2.ready());
52 BOOST_CHECK(100 == co_await d1);
53 BOOST_CHECK(!d1);
54 BOOST_CHECK( d1.ready());
55 co_await d2;
56
57 g.cancel();
58 BOOST_CHECK_THROW(co_await g, boost::system::system_error);
59}
60#endif
61
62CO_TEST_CASE(list)

Callers

nothing calls this directly

Calls 7

left_raceFunction · 0.85
stopClass · 0.85
push_backMethod · 0.80
dummyFunction · 0.70
genFunction · 0.70
readyMethod · 0.45
cancelMethod · 0.45

Tested by

no test coverage detected