From 6f29755ab0f86f29c04a624f439ddefb37a5ba19 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 17 May 2026 17:34:06 +0200 Subject: Silence warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- test.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'test.c') diff --git a/test.c b/test.c index 5a5017e..da565c4 100644 --- a/test.c +++ b/test.c @@ -64,13 +64,13 @@ check(size_t count, char **strings, ...) char *allocations[8];\ size_t i;\ char *p;\ - assert(strings[0] = allocations[0] = strdup("a="));\ - assert(strings[1] = allocations[1] = strdup("aa=1"));\ - assert(strings[2] = allocations[2] = strdup("b=12"));\ - assert(strings[3] = allocations[3] = strdup("bb=34"));\ - assert(strings[4] = allocations[4] = strdup("BB"));\ - assert(strings[5] = allocations[5] = strdup("x=5"));\ - assert(strings[6] = allocations[6] = strdup("xx"));\ + assert((strings[0] = allocations[0] = strdup("a=")));\ + assert((strings[1] = allocations[1] = strdup("aa=1")));\ + assert((strings[2] = allocations[2] = strdup("b=12")));\ + assert((strings[3] = allocations[3] = strdup("bb=34")));\ + assert((strings[4] = allocations[4] = strdup("BB")));\ + assert((strings[5] = allocations[5] = strdup("x=5")));\ + assert((strings[6] = allocations[6] = strdup("xx")));\ strings[7] = allocations[7] = NULL;\ if (!variable_version) {\ for (i = 0; strings[i]; i++) {\ @@ -128,11 +128,11 @@ test_get_chosen_list(void) /* TODO check memory failure behaviour */ { const char **r; - assert(r = libenv_get_chosen_list(LIBENV_END)); + assert((r = libenv_get_chosen_list(LIBENV_END))); assert(!r[0]); free(r); - assert(r = libenv_get_chosen_list(1, LIBENV_END)); + assert((r = libenv_get_chosen_list(1, LIBENV_END))); assert(r[0] && !strcmp(r[0], "a")); assert(r[1] && !strcmp(r[1], "aa")); assert(r[2] && !strcmp(r[2], "BB")); @@ -140,19 +140,19 @@ test_get_chosen_list(void) /* TODO check memory failure behaviour */ assert(!r[4]); free(r); - assert(r = libenv_get_chosen_list(2, LIBENV_END)); + assert((r = libenv_get_chosen_list(2, LIBENV_END))); assert(r[0] && !strcmp(r[0], "aa")); assert(r[1] && !strcmp(r[1], "BB")); assert(r[2] && !strcmp(r[2], "bb")); assert(!r[3]); free(r); - assert(r = libenv_get_chosen_list(3, LIBENV_END)); + assert((r = libenv_get_chosen_list(3, LIBENV_END))); assert(r[0] && !strcmp(r[0], "BB")); assert(!r[1]); free(r); - assert(r = libenv_get_chosen_list(1, 2, LIBENV_END)); + assert((r = libenv_get_chosen_list(1, 2, LIBENV_END))); assert(r[0] && !strcmp(r[0], "a")); assert(r[1] && !strcmp(r[1], "aa")); assert(r[2] && !strcmp(r[2], "BB")); @@ -161,14 +161,14 @@ test_get_chosen_list(void) /* TODO check memory failure behaviour */ assert(!r[5]); free(r); - assert(r = libenv_get_chosen_list(2, 3, LIBENV_END)); + assert((r = libenv_get_chosen_list(2, 3, LIBENV_END))); assert(r[0] && !strcmp(r[0], "aa")); assert(r[1] && !strcmp(r[1], "BB")); assert(r[2] && !strcmp(r[2], "bb")); assert(!r[3]); free(r); - assert(r = libenv_get_chosen_list(3, 1, LIBENV_END)); + assert((r = libenv_get_chosen_list(3, 1, LIBENV_END))); assert(r[0] && !strcmp(r[0], "a")); assert(r[1] && !strcmp(r[1], "aa")); assert(r[2] && !strcmp(r[2], "BB")); @@ -176,7 +176,7 @@ test_get_chosen_list(void) /* TODO check memory failure behaviour */ assert(!r[4]); free(r); - assert(r = libenv_get_chosen_list(1, 2, 3, LIBENV_END)); + assert((r = libenv_get_chosen_list(1, 2, 3, LIBENV_END))); assert(r[0] && !strcmp(r[0], "a")); assert(r[1] && !strcmp(r[1], "aa")); assert(r[2] && !strcmp(r[2], "BB")); @@ -185,15 +185,15 @@ test_get_chosen_list(void) /* TODO check memory failure behaviour */ assert(!r[5]); free(r); - assert(r = libenv_get_chosen_list(10, LIBENV_END)); + assert((r = libenv_get_chosen_list(10, LIBENV_END))); assert(!r[0]); free(r); - assert(r = libenv_get_chosen_list(64, LIBENV_END)); + assert((r = libenv_get_chosen_list(64, LIBENV_END))); assert(!r[0]); free(r); - assert(r = libenv_get_chosen_list(1000, LIBENV_END)); + assert((r = libenv_get_chosen_list(1000, LIBENV_END))); assert(!r[0]); free(r); } -- cgit v1.2.3-70-g09d2