From aad491596536c0d6c3386e8dd0cf6ff94ef86660 Mon Sep 17 00:00:00 2001 From: Jelle Licht Date: Mon, 7 Sep 2026 20:59:28 +0200 Subject: [PATCH] test: avoid side effects in assert, fixes behavior under NDEBUG --- test/test-multiple-wasi-destroys.c | 3 ++- test/test-path-resolution.c | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/test/test-multiple-wasi-destroys.c b/test/test-multiple-wasi-destroys.c index 563537f..9be51a5 100644 --- a/test/test-multiple-wasi-destroys.c +++ b/test/test-multiple-wasi-destroys.c @@ -22,7 +22,8 @@ int main(void) { assert(init_options.preopens == NULL); assert(init_options.allocator == NULL); - assert(0 == uvwasi_init(&uvwasi, &init_options)); + int r = uvwasi_init(&uvwasi, &init_options); + assert(0 == r); /* Calling uvwasi_destroy() multiple times should be fine. */ uvwasi_destroy(&uvwasi); uvwasi_destroy(&uvwasi); diff --git a/test/test-path-resolution.c b/test/test-path-resolution.c index 4c03e2e..40b0694 100644 --- a/test/test-path-resolution.c +++ b/test/test-path-resolution.c @@ -143,7 +143,9 @@ static void create_symlink(char* src, char* real_dst) { int main(void) { uvwasi_options_init(&init_options); - assert(0 == uvwasi_init(&uvwasi, &init_options)); + + int r = uvwasi_init(&uvwasi, &init_options); + assert(0 == r); /* Arguments: input path, expected normalized path */ check_normalize("", ".");