summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.clang-tidy2
-rw-r--r--NEWS3
-rw-r--r--src/posix/filesystem_posix.c1
-rw-r--r--test/test_hash.c2
-rw-r--r--test/test_ring.c2
5 files changed, 7 insertions, 3 deletions
diff --git a/.clang-tidy b/.clang-tidy
index 5380ced..1c5a762 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -5,8 +5,10 @@ Checks: >
*,
-altera-*,
-bugprone-assignment-in-if-condition,
+ -bugprone-switch-missing-default-case,
-hicpp-multiway-paths-covered,
-llvmlibc-*,
+ -misc-include-cleaner,
-readability-identifier-length,
WarningsAsErrors: '*'
HeaderFilterRegex: '.*'
diff --git a/NEWS b/NEWS
index fab3fd4..add72dd 100644
--- a/NEWS
+++ b/NEWS
@@ -3,8 +3,9 @@ zix (0.4.3) unstable; urgency=medium
* Avoid fdatasync() on Darwin
* Fix library current_version on MacOS
* Fix nullability annotations for zix_canonical_path() and friends
+ * Fix ring unit test when mlock() is unavailable
- -- David Robillard <d@drobilla.net> Thu, 14 Mar 2024 16:59:01 +0000
+ -- David Robillard <d@drobilla.net> Thu, 14 Mar 2024 17:42:49 +0000
zix (0.4.2) stable; urgency=medium
diff --git a/src/posix/filesystem_posix.c b/src/posix/filesystem_posix.c
index c752e4a..c82cdf7 100644
--- a/src/posix/filesystem_posix.c
+++ b/src/posix/filesystem_posix.c
@@ -27,6 +27,7 @@
#include <dirent.h>
#include <fcntl.h>
#include <sys/stat.h>
+#include <sys/types.h>
#include <unistd.h>
#include <errno.h>
diff --git a/test/test_hash.c b/test/test_hash.c
index b1de72a..d257924 100644
--- a/test/test_hash.c
+++ b/test/test_hash.c
@@ -135,7 +135,7 @@ stress_with(ZixAllocator* const allocator,
static const size_t string_length = 15;
char* const buffer = (char*)calloc(1, n_elems * (string_length + 1));
- char** const strings = state.strings = (char**)calloc(sizeof(char*), n_elems);
+ char** const strings = state.strings = (char**)calloc(n_elems, sizeof(char*));
state.buffer = buffer;
state.strings = strings;
ENSURE(&state, buffer && state.strings, "Failed to allocate strings\n");
diff --git a/test/test_ring.c b/test/test_ring.c
index 46abe05..b1845ce 100644
--- a/test/test_ring.c
+++ b/test/test_ring.c
@@ -101,7 +101,7 @@ test_ring(const unsigned size)
assert(zix_ring_write_space(ring) == zix_ring_capacity(ring));
const ZixStatus st = zix_ring_mlock(ring);
- assert(!st || st == ZIX_STATUS_NOT_SUPPORTED);
+ assert(!st || st == ZIX_STATUS_NOT_SUPPORTED || st == ZIX_STATUS_UNAVAILABLE);
static const size_t stack_size = (size_t)MSG_SIZE * 4U;