static void test_submit_co(void)

{

    WorkerTestData data;

    Coroutine *co = qemu_coroutine_create(co_test_cb);



    qemu_coroutine_enter(co, &data);



    /* Back here once the worker has started.  */



    g_assert_cmpint(active, ==, 1);

    g_assert_cmpint(data.ret, ==, -EINPROGRESS);



    /* qemu_aio_flush will execute the rest of the coroutine.  */



    qemu_aio_flush();



    /* Back here after the coroutine has finished.  */



    g_assert_cmpint(active, ==, 0);

    g_assert_cmpint(data.ret, ==, 0);

}

static void test_submit_co(void)

{

    WorkerTestData data;

    Coroutine *co = qemu_coroutine_create(co_test_cb);



    qemu_coroutine_enter(co, &data);



    



    g_assert_cmpint(active, ==, 1);

    g_assert_cmpint(data.ret, ==, -EINPROGRESS);



    



    qemu_aio_flush();



    



    g_assert_cmpint(active, ==, 0);

    g_assert_cmpint(data.ret, ==, 0);

}

static void FUNC_0(void)

{

    WorkerTestData data;

    Coroutine *co = qemu_coroutine_create(co_test_cb);



    qemu_coroutine_enter(co, &data);



    



    g_assert_cmpint(active, ==, 1);

    g_assert_cmpint(data.ret, ==, -EINPROGRESS);



    



    qemu_aio_flush();



    



    g_assert_cmpint(active, ==, 0);

    g_assert_cmpint(data.ret, ==, 0);

}

static void FUNC_0(void)
{ WorkerTestData data; Coroutine *co = qemu_coroutine_create(co_test_cb); qemu_coroutine_enter(co, &data); g_assert_cmpint(active, ==, 1); g_assert_cmpint(data.ret, ==, -EINPROGRESS); qemu_aio_flush(); g_assert_cmpint(active, ==, 0); g_assert_cmpint(data.ret, ==, 0); }