Commit 271b385e authored by Stefan Hajnoczi's avatar Stefan Hajnoczi
Browse files

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: default avatarEduardo Habkost <ehabkost@redhat.com>
Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: default avatarFam Zheng <famz@redhat.com>
Message-id: 1463767231-13379-1-git-send-email-stefanha@redhat.com
parent 76462405
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -369,7 +369,15 @@ static void perf_cost(void)
int main(int argc, char **argv)
{
    g_test_init(&argc, &argv, NULL);

    /* 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);