aboutgitcodelistschat:MatrixIRC
path: root/tests/unit/testutil.h
diff options
context:
space:
mode:
authorAlice Frosi <afrosi@redhat.com>2023-06-30 11:22:52 +0200
committerAlice Frosi <afrosi@redhat.com>2023-07-03 17:28:33 +0200
commit876a52e95a9d24a4b9fa37325d83bcb7d3c7b160 (patch)
tree69edae1a49a42fb9abdf749797d8286b16c2ca3e /tests/unit/testutil.h
parent06791d85cff567ff038ececc19d6e775dab84840 (diff)
downloadseitan-876a52e95a9d24a4b9fa37325d83bcb7d3c7b160.tar
seitan-876a52e95a9d24a4b9fa37325d83bcb7d3c7b160.tar.gz
seitan-876a52e95a9d24a4b9fa37325d83bcb7d3c7b160.tar.bz2
seitan-876a52e95a9d24a4b9fa37325d83bcb7d3c7b160.tar.lz
seitan-876a52e95a9d24a4b9fa37325d83bcb7d3c7b160.tar.xz
seitan-876a52e95a9d24a4b9fa37325d83bcb7d3c7b160.tar.zst
seitan-876a52e95a9d24a4b9fa37325d83bcb7d3c7b160.zip
test: fix filter-build test and bugs
The tests for checking the filter build recompile and are successfull. Changes: - spotted a couple of bugs for adding the arguments in the filter - readded function `filter_flush_args` to flush_args; this is needed to distinguish when the arguments belong to the same block or are different entries to the same syscall - build the filter in a way that CMP_EQ corresponds to BPF_JEQ and we don't need to awkwardly negate the operations (still TODO for AND_EQ)
Diffstat (limited to 'tests/unit/testutil.h')
-rw-r--r--tests/unit/testutil.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/unit/testutil.h b/tests/unit/testutil.h
index a0fa0b8..caccd44 100644
--- a/tests/unit/testutil.h
+++ b/tests/unit/testutil.h
@@ -58,7 +58,7 @@ static inline void *test_gluten_write_ptr(struct gluten *g,
ck_assert_ptr_nonnull(p); \
memcpy(&ref, p, sizeof(ref)); \
} while (0)
-
+#define NS_NUM CONTEXT_TYPE_MAX - 3
struct args_target {
long ret;
int err;
@@ -67,7 +67,7 @@ struct args_target {
int fd;
int nr;
bool filter_args[6];
- struct bpf_arg args[6];
+ struct bpf_field bpf_fields[6];
void *targs[6];
void *tclone;
bool ns[NS_NUM];