From 5bc4c0663576fd99bb06068e6dfd624690865c89 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Sun, 25 Oct 2026 19:42:27 +0100 Subject: Be stricter about const char*, Wwrite-strings will warn in the future and we don't want to try to overwrite string literals --- tests/runner.c | 1 + tests/stubs.c | 9 +++++++++ tests/test.h | 1 + 3 files changed, 11 insertions(+) (limited to 'tests') diff --git a/tests/runner.c b/tests/runner.c index db62246..972a56a 100644 --- a/tests/runner.c +++ b/tests/runner.c @@ -23,6 +23,7 @@ static const struct module modules[] = {{"scan_urlencoded_query", test_scan_urle {"ot_buf", test_buf}, {"ot_ip", test_ip}, {"ot_socket", test_socket}, + {"ot_mutex", test_mutex}, {"ot_accesslist", test_accesslist}, {NULL, NULL}}; diff --git a/tests/stubs.c b/tests/stubs.c index ce93071..09a7312 100644 --- a/tests/stubs.c +++ b/tests/stubs.c @@ -18,3 +18,12 @@ void free_peerlist(ot_peerlist *peer_list) { (void)peer_list; } neither of which any test drives. */ time_t g_now_seconds; volatile int g_opentracker_running; + +/* ot_mutex.c wakes the main loop through the self pipe when a result is + ready. The queue tests never get that far. */ +int g_self_pipe[2] = {-1, -1}; +long io_trywrite(long d, const char *buf, long len) { + (void)d; + (void)buf; + return len; +} diff --git a/tests/test.h b/tests/test.h index d79c4d2..9677524 100644 --- a/tests/test.h +++ b/tests/test.h @@ -86,5 +86,6 @@ void test_scan(void); void test_buf(void); void test_ip(void); void test_socket(void); +void test_mutex(void); #endif -- cgit v1.3