aboutgitcodelistschat:MatrixIRC
path: root/tests/unit/util.c
diff options
context:
space:
mode:
authorAlice Frosi <afrosi@redhat.com>2023-05-05 17:04:15 +0200
committerAlice Frosi <afrosi@redhat.com>2023-05-08 14:47:22 +0200
commit384d09cd3d2e62bae19b59b615bc57b7a23d0b0a (patch)
tree3b6ba748a07d8e7e1b687314517e3379c59a69e3 /tests/unit/util.c
parentc29157e78df7fa335c56d0d7f2cca7dc50bfffd6 (diff)
downloadseitan-384d09cd3d2e62bae19b59b615bc57b7a23d0b0a.tar
seitan-384d09cd3d2e62bae19b59b615bc57b7a23d0b0a.tar.gz
seitan-384d09cd3d2e62bae19b59b615bc57b7a23d0b0a.tar.bz2
seitan-384d09cd3d2e62bae19b59b615bc57b7a23d0b0a.tar.lz
seitan-384d09cd3d2e62bae19b59b615bc57b7a23d0b0a.tar.xz
seitan-384d09cd3d2e62bae19b59b615bc57b7a23d0b0a.tar.zst
seitan-384d09cd3d2e62bae19b59b615bc57b7a23d0b0a.zip
test: fix operations
Adjust the tests after the refactoring and to use struct gluten_offset
Diffstat (limited to 'tests/unit/util.c')
-rw-r--r--tests/unit/util.c16
1 files changed, 13 insertions, 3 deletions
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 <sys/socket.h>
#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;