MCPcopy Create free account
hub / github.com/JRickey/BattleShip / test_stack_preservation

Function test_stack_preservation

port/coroutine_test.cpp:129–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127}
128
129void 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. */
143volatile int g_in_coro_seen = -1;

Callers 1

mainFunction · 0.85

Calls 4

port_coroutine_createFunction · 0.70
port_coroutine_resumeFunction · 0.70
port_coroutine_destroyFunction · 0.70

Tested by

no test coverage detected