From e30c50d87ac7c2bc663074839ce12a9ac5796de7 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 9 Jan 2024 17:21:28 -0500 Subject: 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. --- test/test_state.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'test/test_state.c') 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); -- cgit v1.2.1