| 85 | }; |
| 86 | |
| 87 | void 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 | |
| 132 | static int i0; |
| 133 |
nothing calls this directly
no test coverage detected