diff options
author | David Robillard <d@drobilla.net> | 2024-11-15 14:27:37 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2024-11-15 14:27:52 -0500 |
commit | e58b18dbcea3646ac9ec8b0d96f54c1111819d59 (patch) | |
tree | 096b10fbba662a320012cb57e060f91b5762b1eb /benchmark/tree_bench.c | |
parent | 69081b4c2a78c2eeaa816ade57ff9fffcd96e564 (diff) | |
download | zix-e58b18dbcea3646ac9ec8b0d96f54c1111819d59.tar.gz zix-e58b18dbcea3646ac9ec8b0d96f54c1111819d59.tar.bz2 zix-e58b18dbcea3646ac9ec8b0d96f54c1111819d59.zip |
Assert that allocation and file opening succeeds in tests
This appeases GCC's static analyzer.
Diffstat (limited to 'benchmark/tree_bench.c')
-rw-r--r-- | benchmark/tree_bench.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/benchmark/tree_bench.c b/benchmark/tree_bench.c index 8cc2711..2c8f896 100644 --- a/benchmark/tree_bench.c +++ b/benchmark/tree_bench.c @@ -15,6 +15,7 @@ ZIX_DISABLE_GLIB_WARNINGS #include <glib.h> ZIX_RESTORE_WARNINGS +#include <assert.h> #include <inttypes.h> #include <stdbool.h> #include <stdio.h> @@ -281,6 +282,11 @@ main(int argc, char** argv) FILE* search_dat = fopen("tree_search.txt", "w"); FILE* iter_dat = fopen("tree_iterate.txt", "w"); FILE* del_dat = fopen("tree_delete.txt", "w"); + assert(insert_dat); + assert(search_dat); + assert(iter_dat); + assert(del_dat); + fprintf(insert_dat, HEADER); fprintf(search_dat, HEADER); fprintf(iter_dat, HEADER); |