From fcd7cf56f168602ae008875f21ea1494643ff004 Mon Sep 17 00:00:00 2001 From: Alberto Leiva Popper Date: Fri, 3 Feb 2023 15:43:23 -0600 Subject: [PATCH] Update unit tests --- src/thread/thread_pool.c | 1 + test/rtr/db/vrps_test.c | 2 +- test/tal_test.c | 19 +++++++++++++++++++ test/thread_pool_test.c | 1 + 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/thread/thread_pool.c b/src/thread/thread_pool.c index 1b38e93b..27de91b9 100644 --- a/src/thread/thread_pool.c +++ b/src/thread/thread_pool.c @@ -402,6 +402,7 @@ thread_pool_push(struct thread_pool *pool, char const *task_name, struct thread_pool_task *task; int error; + task = NULL; error = task_create(task_name, cb, arg, &task); if (error) return error; diff --git a/test/rtr/db/vrps_test.c b/test/rtr/db/vrps_test.c index d96b1eec..51a610e0 100644 --- a/test/rtr/db/vrps_test.c +++ b/test/rtr/db/vrps_test.c @@ -272,7 +272,7 @@ check_base(serial_t expected_serial, bool const *expected_base) static int vrp_add(struct delta_vrp const *delta, void *arg) { - return deltas_add_roa(arg, &delta->vrp, delta->flags); + return deltas_add_roa(arg, &delta->vrp, delta->flags, 'a', 0, 0); } static int diff --git a/test/tal_test.c b/test/tal_test.c index 0f7399ab..ac5a4e90 100644 --- a/test/tal_test.c +++ b/test/tal_test.c @@ -110,6 +110,25 @@ db_rrdp_rem_nonvisited_tals(void) /* Empty */ } +void +panic_on_fail(int error, char const *function_name) +{ + if (error) + ck_abort_msg("%s() returned errcode %d", function_name, error); +} + +void +mutex_lock(pthread_mutex_t *lock) +{ + /* Empty */ +} + +void +mutex_unlock(pthread_mutex_t *lock) +{ + /* Empty */ +} + START_TEST(tal_load_normal) { struct tal *tal; diff --git a/test/thread_pool_test.c b/test/thread_pool_test.c index 0c984138..78138264 100644 --- a/test/thread_pool_test.c +++ b/test/thread_pool_test.c @@ -2,6 +2,7 @@ #include #include +#include "common.c" #include "log.c" #include "impersonator.c" #include "thread/thread_pool.c" -- 2.47.3