diff options
| author | Stefan Hajnoczi | 2016-05-20 20:00:31 +0200 |
|---|---|---|
| committer | Stefan Hajnoczi | 2016-06-07 15:40:50 +0200 |
| commit | 271b385e7ec2f1ca23c5345599cd58d9651427e5 (patch) | |
| tree | b5c9f072321fbcd17cf228ed2cd174dd0765b03d | |
| parent | Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20160606-... (diff) | |
| download | qemu-271b385e7ec2f1ca23c5345599cd58d9651427e5.tar.gz qemu-271b385e7ec2f1ca23c5345599cd58d9651427e5.tar.xz qemu-271b385e7ec2f1ca23c5345599cd58d9651427e5.zip | |
tests: avoid coroutine pool test crash
Skip the test_co_queue test case if the coroutine pool is not enabled.
The test case does not work without the pool because it touches memory
belonging to a freed coroutine (on purpose).
Reported-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Message-id: 1463767231-13379-1-git-send-email-stefanha@redhat.com
| -rw-r--r-- | tests/test-coroutine.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/test-coroutine.c b/tests/test-coroutine.c index dd4ced946c..ea7f87f487 100644 --- a/tests/test-coroutine.c +++ b/tests/test-coroutine.c @@ -369,7 +369,15 @@ static void perf_cost(void) int main(int argc, char **argv) { g_test_init(&argc, &argv, NULL); - g_test_add_func("/basic/co_queue", test_co_queue); + + /* This test assumes there is a freelist and marks freed coroutine memory + * with a sentinel value. If there is no freelist this would legitimately + * crash, so skip it. + */ + if (CONFIG_COROUTINE_POOL) { + g_test_add_func("/basic/co_queue", test_co_queue); + } + g_test_add_func("/basic/lifecycle", test_lifecycle); g_test_add_func("/basic/yield", test_yield); g_test_add_func("/basic/nesting", test_nesting); |
