| 1 | From aad491596536c0d6c3386e8dd0cf6ff94ef86660 Mon Sep 17 00:00:00 2001
|
| 2 | From: Jelle Licht <[email protected]>
|
| 3 | Date: Mon, 7 Sep 2026 20:59:28 +0200
|
| 4 | Subject: [PATCH] test: avoid side effects in assert, fixes behavior under
|
| 5 | NDEBUG
|
| 6 |
|
| 7 | ---
|
| 8 | test/test-multiple-wasi-destroys.c | 3 ++-
|
| 9 | test/test-path-resolution.c | 4 +++-
|
| 10 | 2 files changed, 5 insertions(+), 2 deletions(-)
|
| 11 |
|
| 12 | diff --git a/test/test-multiple-wasi-destroys.c b/test/test-multiple-wasi-destroys.c
|
| 13 | index 563537f..9be51a5 100644
|
| 14 | |
| 15 | |
| 16 | @@ -22,7 +22,8 @@ int main(void) {
|
| 17 | assert(init_options.preopens == NULL);
|
| 18 | assert(init_options.allocator == NULL);
|
| 19 |
|
| 20 | - assert(0 == uvwasi_init(&uvwasi, &init_options));
|
| 21 | + int r = uvwasi_init(&uvwasi, &init_options);
|
| 22 | + assert(0 == r);
|
| 23 | /* Calling uvwasi_destroy() multiple times should be fine. */
|
| 24 | uvwasi_destroy(&uvwasi);
|
| 25 | uvwasi_destroy(&uvwasi);
|
| 26 | diff --git a/test/test-path-resolution.c b/test/test-path-resolution.c
|
| 27 | index 4c03e2e..40b0694 100644
|
| 28 | |
| 29 | |
| 30 | @@ -143,7 +143,9 @@ static void create_symlink(char* src, char* real_dst) {
|
| 31 |
|
| 32 | int main(void) {
|
| 33 | uvwasi_options_init(&init_options);
|
| 34 | - assert(0 == uvwasi_init(&uvwasi, &init_options));
|
| 35 | +
|
| 36 | + int r = uvwasi_init(&uvwasi, &init_options);
|
| 37 | + assert(0 == r);
|
| 38 |
|
| 39 | /* Arguments: input path, expected normalized path */
|
| 40 | check_normalize("", ".");
|