From 384d09cd3d2e62bae19b59b615bc57b7a23d0b0a Mon Sep 17 00:00:00 2001 From: Alice Frosi Date: Fri, 5 May 2023 17:04:15 +0200 Subject: test: fix operations Adjust the tests after the refactoring and to use struct gluten_offset --- tests/unit/util.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'tests/unit/util.c') diff --git a/tests/unit/util.c b/tests/unit/util.c index f552ea2..45171f2 100644 --- a/tests/unit/util.c +++ b/tests/unit/util.c @@ -21,8 +21,7 @@ #include #include "testutil.h" -#include "common.h" -#include "filter.h" +#include "common/common.h" struct seccomp_notif req; int notifyfd; @@ -30,7 +29,7 @@ struct args_target *at; int pipefd[2]; pid_t pid; char path[PATH_MAX] = "/tmp/test-seitan"; -uint16_t tmp_data[TMP_DATA_SIZE]; +struct gluten gluten; int install_notification_filter(struct args_target *at) { @@ -155,6 +154,17 @@ void check_target_result(long ret, int err, bool ignore_ret) ck_assert_int_eq(close(pipefd[0]), 0); } +void check_target_result_nonegative() +{ + int buf; + + read(pipefd[0], &buf, 1); + ck_assert_msg(at->ret > -1, + "expect return value %ld to be greater then -1", at->ret); + ck_assert_int_eq(at->err, 0); + ck_assert_int_eq(close(pipefd[0]), 0); +} + void continue_target() { struct seccomp_notif_resp resp; -- cgit v1.2.3