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

Method TestException

library/cpp/coroutine/engine/coroutine_ut.cpp:87–130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85};
86
87void TCoroTest::TestException() {
88 TContExecutor e(1000000);
89
90 bool f2run = false;
91
92 auto f1 = [&f2run](TCont* c) {
93 struct TCtx {
94 ~TCtx() {
95 Y_ABORT_UNLESS(!*F2);
96
97 C->Yield();
98 }
99
100 TCont* C;
101 bool* F2;
102 };
103
104 try {
105 TCtx ctx = {c, &f2run};
106
107 throw 1;
108 } catch (...) {
109 }
110 };
111
112 bool unc = true;
113
114 auto f2 = [&unc, &f2run](TCont*) {
115 f2run = true;
116 unc = std::uncaught_exceptions();
117
118 // check segfault
119 try {
120 throw 2;
121 } catch (int) {
122 }
123 };
124
125 e.Create(f1, "f1");
126 e.Create(f2, "f2");
127 e.Execute();
128
129 UNIT_ASSERT(!unc);
130}
131
132static int i0;
133

Callers

nothing calls this directly

Calls 3

uncaught_exceptionsFunction · 0.85
CreateMethod · 0.45
ExecuteMethod · 0.45

Tested by

no test coverage detected