MCPcopy Create free account
hub / github.com/catboost/catboost / TestPause

Method TestPause

library/cpp/coroutine/engine/coroutine_ut.cpp:955–970  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

953}
954
955void TCoroTest::TestPause() {
956 TContExecutor executor{1024*1024, IPollerFace::Default(), nullptr, nullptr, NCoro::NStack::EGuard::Canary, Nothing()};
957
958 int i = 0;
959 executor.CreateOwned([&](TCont*) {
960 i++;
961 executor.Pause();
962 i++;
963 }, "coro");
964
965 UNIT_ASSERT_EQUAL(i, 0);
966 executor.Execute();
967 UNIT_ASSERT_EQUAL(i, 1);
968 executor.Execute();
969 UNIT_ASSERT_EQUAL(i, 2);
970}
971
972void TCoroTest::TestUserEvent() {
973 TContExecutor exec(32000);

Callers

nothing calls this directly

Calls 5

DefaultFunction · 0.85
NothingFunction · 0.85
CreateOwnedMethod · 0.80
PauseMethod · 0.80
ExecuteMethod · 0.45

Tested by

no test coverage detected