From 7e6b36bc2d332a3cb66b83116a393ac4728236d5 Mon Sep 17 00:00:00 2001 From: Mitya Selivanov Date: Thu, 29 Dec 2022 07:51:16 +0100 Subject: Improve C89/90 compat --- source/test/unittests/async_function.test.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'source/test/unittests/async_function.test.c') diff --git a/source/test/unittests/async_function.test.c b/source/test/unittests/async_function.test.c index 6e1bc69..320f323 100644 --- a/source/test/unittests/async_function.test.c +++ b/source/test/unittests/async_function.test.c @@ -48,7 +48,8 @@ STATIC_CORO(int, test_nest_generator, AF_TYPE(test_gen) promise;) { CORO_END STATIC_CORO(int, test_join_multiple, AF_TYPE(test_bar) promises[3];) { - for (int i = 0; i < 3; i++) + int i; + for (i = 0; i < 3; i++) AF_INIT(af promises[i], test_bar, .return_value = 0); AF_RESUME_AND_JOIN_ALL(af promises); AF_RETURN(af promises[0].return_value + @@ -59,7 +60,8 @@ CORO_END STATIC_CORO(int, test_await_multiple, AF_TYPE(test_bar) promises[3];) { - for (int i = 0; i < 3; i++) + int i; + for (i = 0; i < 3; i++) AF_INIT(af promises[i], test_bar, .return_value = 0); AF_AWAIT_ALL(af promises); AF_RETURN(af promises[0].return_value + @@ -131,8 +133,9 @@ TEST("coroutine suspend") { } TEST("coroutine generator") { + int i; AF_CREATE(promise, test_gen, .min = 10, .max = 15); - for (int i = 0; i <= 5; i++) + for (i = 0; i <= 5; i++) REQUIRE(AF_RESUME_AND_JOIN(promise) == 10 + i); } -- cgit v1.2.3