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

Method TestNestedExecutor

library/cpp/coroutine/engine/coroutine_ut.cpp:870–895  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

868}
869
870void TCoroTest::TestNestedExecutor() {
871#ifndef _win_
872 //nested executors actually don't work correctly, but anyway shouldn't break RunningCont() ptr
873 TContExecutor exec(32000);
874 UNIT_ASSERT(!RunningCont());
875
876 exec.Execute([](TCont* cont, void*) {
877 UNIT_ASSERT_VALUES_EQUAL(RunningCont(), cont);
878
879 TContExecutor exec2(32000);
880 exec2.Execute([](TCont* cont2, void*) {
881 UNIT_ASSERT_VALUES_EQUAL(RunningCont(), cont2);
882 TContExecutor exec3(32000);
883 exec3.Execute([](TCont* cont3, void*) {
884 UNIT_ASSERT_VALUES_EQUAL(RunningCont(), cont3);
885 });
886
887 UNIT_ASSERT_VALUES_EQUAL(RunningCont(), cont2);
888 });
889
890 UNIT_ASSERT_VALUES_EQUAL(RunningCont(), cont);
891 });
892
893 UNIT_ASSERT(!RunningCont());
894#endif
895}
896
897void TCoroTest::TestComputeCoroutineYield() {
898//if we have busy (e.g., on cpu) coroutine, when it yields, io must flow

Callers

nothing calls this directly

Calls 2

RunningContFunction · 0.85
ExecuteMethod · 0.45

Tested by

no test coverage detected