| 127 | } |
| 128 | |
| 129 | void test_stack_preservation() { |
| 130 | PortCoroutine *a = port_coroutine_create(stack_worker, (void *)0xCAFEBABE, 128 * 1024); |
| 131 | PortCoroutine *b = port_coroutine_create(stack_worker, (void *)0xDEADBEEF, 128 * 1024); |
| 132 | port_coroutine_resume(a); |
| 133 | port_coroutine_resume(b); |
| 134 | port_coroutine_resume(a); |
| 135 | port_coroutine_resume(b); |
| 136 | EXPECT(port_coroutine_is_finished(a)); |
| 137 | EXPECT(port_coroutine_is_finished(b)); |
| 138 | port_coroutine_destroy(a); |
| 139 | port_coroutine_destroy(b); |
| 140 | } |
| 141 | |
| 142 | /* in_coroutine query: false from main, true from inside a worker. */ |
| 143 | volatile int g_in_coro_seen = -1; |
no test coverage detected