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

Method TestUserEvent

library/cpp/coroutine/engine/coroutine_ut.cpp:972–993  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

970}
971
972void TCoroTest::TestUserEvent() {
973 TContExecutor exec(32000);
974
975 struct TUserEvent : public IUserEvent {
976 bool Called = false;
977 void Execute() override {
978 Called = true;
979 }
980 } event;
981
982 auto f = [&](TCont* cont) {
983 UNIT_ASSERT(!event.Called);
984 exec.ScheduleUserEvent(&event);
985 UNIT_ASSERT(!event.Called);
986 cont->Yield();
987 UNIT_ASSERT(event.Called);
988 };
989
990 exec.Execute(f);
991
992 UNIT_ASSERT(event.Called);
993}
994
995void TCoroTest::TestOverrideTime() {
996 class TTime: public NCoro::ITime {

Callers

nothing calls this directly

Calls 3

ScheduleUserEventMethod · 0.80
YieldMethod · 0.80
ExecuteMethod · 0.45

Tested by

no test coverage detected