aboutgitcodelistschat:MatrixIRC
path: root/tests/unit/util.c
diff options
context:
space:
mode:
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;