mirror of https://github.com/yandex/odyssey.git
32 lines
408 B
C
32 lines
408 B
C
|
|
||
|
#include <machinarium.h>
|
||
|
#include <odyssey_test.h>
|
||
|
|
||
|
static int coroutine_call = 0;
|
||
|
|
||
|
static void
|
||
|
coroutine(void *arg)
|
||
|
{
|
||
|
(void)arg;
|
||
|
coroutine_call++;
|
||
|
machine_stop();
|
||
|
}
|
||
|
|
||
|
void
|
||
|
machinarium_test_create0(void)
|
||
|
{
|
||
|
machinarium_init();
|
||
|
|
||
|
int id;
|
||
|
id = machine_create("test", coroutine, NULL);
|
||
|
test(id != -1);
|
||
|
|
||
|
int rc;
|
||
|
rc = machine_wait(id);
|
||
|
test(rc != -1);
|
||
|
|
||
|
test(coroutine_call == 1);
|
||
|
|
||
|
machinarium_free();
|
||
|
}
|