2018-04-04 14:35:50 +00:00
|
|
|
|
|
|
|
#include <machinarium.h>
|
|
|
|
#include <odyssey_test.h>
|
|
|
|
|
2020-12-28 11:22:53 +00:00
|
|
|
static void coroutine(void *arg)
|
2018-04-04 14:35:50 +00:00
|
|
|
{
|
|
|
|
(void)arg;
|
|
|
|
machine_sleep(0);
|
2020-03-20 07:50:05 +00:00
|
|
|
machine_stop_current();
|
2018-04-04 14:35:50 +00:00
|
|
|
}
|
|
|
|
|
2020-12-28 11:22:53 +00:00
|
|
|
void machinarium_test_sleep_yield(void)
|
2018-04-04 14:35:50 +00:00
|
|
|
{
|
|
|
|
machinarium_init();
|
|
|
|
|
|
|
|
int id;
|
|
|
|
id = machine_create("test", coroutine, NULL);
|
|
|
|
test(id != -1);
|
|
|
|
|
|
|
|
int rc;
|
|
|
|
rc = machine_wait(id);
|
|
|
|
test(rc != -1);
|
|
|
|
|
|
|
|
machinarium_free();
|
|
|
|
}
|