diff options
| author | Dirk Engling <erdgeist@erdgeist.org> | 2026-10-25 19:42:27 +0100 |
|---|---|---|
| committer | Dirk Engling <erdgeist@erdgeist.org> | 2026-10-25 19:42:27 +0100 |
| commit | 5bc4c0663576fd99bb06068e6dfd624690865c89 (patch) | |
| tree | e1e90e6966abebf960ed9c9d4ed0937be22961ff /tests | |
| parent | 33b095eb26ab8be3af48d8bd034262cd5ab03a04 (diff) | |
Be stricter about const char*, Wwrite-strings will warn in the future and we don't want to try to overwrite string literals
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/runner.c | 1 | ||||
| -rw-r--r-- | tests/stubs.c | 9 | ||||
| -rw-r--r-- | tests/test.h | 1 |
3 files changed, 11 insertions, 0 deletions
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 | |||
| 23 | {"ot_buf", test_buf}, | 23 | {"ot_buf", test_buf}, |
| 24 | {"ot_ip", test_ip}, | 24 | {"ot_ip", test_ip}, |
| 25 | {"ot_socket", test_socket}, | 25 | {"ot_socket", test_socket}, |
| 26 | {"ot_mutex", test_mutex}, | ||
| 26 | {"ot_accesslist", test_accesslist}, | 27 | {"ot_accesslist", test_accesslist}, |
| 27 | {NULL, NULL}}; | 28 | {NULL, NULL}}; |
| 28 | 29 | ||
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; } | |||
| 18 | neither of which any test drives. */ | 18 | neither of which any test drives. */ |
| 19 | time_t g_now_seconds; | 19 | time_t g_now_seconds; |
| 20 | volatile int g_opentracker_running; | 20 | volatile int g_opentracker_running; |
| 21 | |||
| 22 | /* ot_mutex.c wakes the main loop through the self pipe when a result is | ||
| 23 | ready. The queue tests never get that far. */ | ||
| 24 | int g_self_pipe[2] = {-1, -1}; | ||
| 25 | long io_trywrite(long d, const char *buf, long len) { | ||
| 26 | (void)d; | ||
| 27 | (void)buf; | ||
| 28 | return len; | ||
| 29 | } | ||
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); | |||
| 86 | void test_buf(void); | 86 | void test_buf(void); |
| 87 | void test_ip(void); | 87 | void test_ip(void); |
| 88 | void test_socket(void); | 88 | void test_socket(void); |
| 89 | void test_mutex(void); | ||
| 89 | 90 | ||
| 90 | #endif | 91 | #endif |
