Skip to content

Commit 7e70cdb

Browse files
bonzinikevmw
authored andcommitted
test-coroutine: prepare for the next patch
The next patch moves the coroutine argument from first-enter to creation time. In this case, coroutine has not been initialized yet when the coroutine is created, so change to a pointer. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
1 parent 7d9c858 commit 7e70cdb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/test-coroutine.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,16 @@ static void test_in_coroutine(void)
4040

4141
static void coroutine_fn verify_self(void *opaque)
4242
{
43-
g_assert(qemu_coroutine_self() == opaque);
43+
Coroutine **p_co = opaque;
44+
g_assert(qemu_coroutine_self() == *p_co);
4445
}
4546

4647
static void test_self(void)
4748
{
4849
Coroutine *coroutine;
4950

5051
coroutine = qemu_coroutine_create(verify_self);
51-
qemu_coroutine_enter(coroutine, coroutine);
52+
qemu_coroutine_enter(coroutine, &coroutine);
5253
}
5354

5455
/*

0 commit comments

Comments
 (0)