diff options
author | David Robillard <d@drobilla.net> | 2024-01-09 17:21:28 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2024-01-09 17:28:24 -0500 |
commit | e30c50d87ac7c2bc663074839ce12a9ac5796de7 (patch) | |
tree | 342e39bc6f20ba79d67c16907a03d0a414caf674 /test | |
parent | 81bd78db915bc0d11f23386e49ffe29968ded486 (diff) | |
download | lilv-e30c50d87ac7c2bc663074839ce12a9ac5796de7.tar.gz lilv-e30c50d87ac7c2bc663074839ce12a9ac5796de7.tar.bz2 lilv-e30c50d87ac7c2bc663074839ce12a9ac5796de7.zip |
Fix potential null dereferences and conversion warnings
A few of these can't actually happen, but that's opaque to static analysis, so
appease clang-tidy with casts since the checks are too valuable to suppress.
Diffstat (limited to 'test')
-rw-r--r-- | test/test_state.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/test/test_state.c b/test/test_state.c index 3ab2148..67325d2 100644 --- a/test/test_state.c +++ b/test/test_state.c @@ -122,6 +122,12 @@ create_test_directories(void) dirs.copy = zix_path_join(NULL, dirs.shared, "copy"); dirs.link = zix_path_join(NULL, dirs.shared, "link"); + assert(dirs.top); + assert(dirs.shared); + assert(dirs.scratch); + assert(dirs.copy); + assert(dirs.link); + assert(!mkdir(dirs.shared, 0700)); assert(!mkdir(dirs.scratch, 0700)); assert(!mkdir(dirs.copy, 0700)); @@ -553,7 +559,8 @@ count_statements(const char* path) SerdNode uri = serd_node_new_file_uri((const uint8_t*)path, NULL, NULL, true); - assert(!serd_reader_read_file(reader, uri.buf)); + assert(uri.buf); + assert(!serd_reader_read_file(reader, (const uint8_t*)uri.buf)); serd_node_free(&uri); serd_reader_free(reader); |