summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2024-06-22 19:05:00 -0400
committerDavid Robillard <d@drobilla.net>2024-06-22 19:32:12 -0400
commit59326462e707791d15d47b11151a156d45363b01 (patch)
treeb7d83b21e94a43c463f53688a75d62e18a17a977 /test
parent0f72dec01c209ab1833c0603211cbab46fd8041d (diff)
downloadzix-59326462e707791d15d47b11151a156d45363b01.tar.gz
zix-59326462e707791d15d47b11151a156d45363b01.tar.bz2
zix-59326462e707791d15d47b11151a156d45363b01.zip
Avoid cppcheck warning for assertions with side-effects in tests
Diffstat (limited to 'test')
-rw-r--r--test/meson.build1
-rw-r--r--test/test_thread.c9
2 files changed, 7 insertions, 3 deletions
diff --git a/test/meson.build b/test/meson.build
index 308b562..fbcaac9 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -48,7 +48,6 @@ if not meson.is_subproject() and get_option('lint')
'--enable=warning,style,performance,portability',
'--error-exitcode=1',
'--project=' + compdb_path,
- '--suppress=assertWithSideEffect',
'--suppress=constParameterCallback',
'--suppress=constParameterPointer',
'--suppress=constVariablePointer',
diff --git a/test/test_thread.c b/test/test_thread.c
index 8cfc9f4..09edde6 100644
--- a/test/test_thread.c
+++ b/test/test_thread.c
@@ -3,6 +3,7 @@
#undef NDEBUG
+#include "zix/status.h"
#include "zix/thread.h"
#include <assert.h>
@@ -32,8 +33,12 @@ main(int argc, char** argv)
SharedData data = {argc + (int)strlen(argv[0]), 0};
- assert(!zix_thread_create(&thread, 128, thread_func, &data));
- assert(!zix_thread_join(thread));
+ ZixStatus st = zix_thread_create(&thread, 128, thread_func, &data);
+ assert(!st);
+
+ st = zix_thread_join(thread);
+ assert(!st);
+
assert(data.output == data.input * 7);
return 0;