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

Method TestPollEngines

library/cpp/coroutine/engine/coroutine_ut.cpp:928–953  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

926}
927
928void TCoroTest::TestPollEngines() {
929 bool defaultChecked = false;
930 for (auto engine : GetEnumAllValues<EContPoller>()) {
931 auto poller = IPollerFace::Construct(engine);
932 if (!poller) {
933 continue;
934 }
935
936 TContExecutor exec(32000, IPollerFace::Construct(engine));
937
938 if (engine == EContPoller::Default) {
939 defaultChecked = true;
940#if defined(HAVE_EPOLL_POLLER)
941 UNIT_ASSERT_VALUES_EQUAL(exec.Poller()->PollEngine(), EContPoller::Epoll);
942#elif defined(HAVE_KQUEUE_POLLER)
943 UNIT_ASSERT_VALUES_EQUAL(exec.Poller()->PollEngine(), EContPoller::Kqueue);
944#else
945 UNIT_ASSERT_VALUES_EQUAL(exec.Poller()->PollEngine(), EContPoller::Select);
946#endif
947 } else {
948 UNIT_ASSERT_VALUES_EQUAL(exec.Poller()->PollEngine(), engine);
949 }
950 }
951
952 UNIT_ASSERT(defaultChecked);
953}
954
955void TCoroTest::TestPause() {
956 TContExecutor executor{1024*1024, IPollerFace::Default(), nullptr, nullptr, NCoro::NStack::EGuard::Canary, Nothing()};

Callers

nothing calls this directly

Calls 3

PollerMethod · 0.80
ConstructFunction · 0.50
PollEngineMethod · 0.45

Tested by

no test coverage detected