From 92de40d33e085040e4b9936ae1ddebf152dff102 Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Mon, 25 Nov 2024 08:39:44 -0700 Subject: libcr: Return if all coroutines exit --- libcr/tests/test_matrix.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'libcr/tests') diff --git a/libcr/tests/test_matrix.c b/libcr/tests/test_matrix.c index f1aa6fe..1f23455 100644 --- a/libcr/tests/test_matrix.c +++ b/libcr/tests/test_matrix.c @@ -4,17 +4,21 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ -#include /* for exit(3) */ - #include +int a = 1; + COROUTINE cr_init(void *) { cr_begin(); - exit(0); + a = 2; cr_end(); } int main() { coroutine_add("init", cr_init, NULL); coroutine_main(); + if (a != 2) + return 1; + coroutine_main(); + return 0; } -- cgit v1.2.3-2-g168b