aboutgitcodelistschat:MatrixIRC
diff options
context:
space:
mode:
authorAlice Frosi <afrosi@redhat.com>2023-02-27 11:02:50 +0100
committerAlice Frosi <afrosi@redhat.com>2023-02-27 12:06:28 +0100
commitb46f5dba8b990cdbb7c3e6f9217da09dbe251372 (patch)
treee7b016d9d7abadfa16ef57c88789621ed36ff6e4
parentf219fada2e1107ce1a0f69bab03ee93d92d7b6f3 (diff)
downloadseitan-b46f5dba8b990cdbb7c3e6f9217da09dbe251372.tar
seitan-b46f5dba8b990cdbb7c3e6f9217da09dbe251372.tar.gz
seitan-b46f5dba8b990cdbb7c3e6f9217da09dbe251372.tar.bz2
seitan-b46f5dba8b990cdbb7c3e6f9217da09dbe251372.tar.lz
seitan-b46f5dba8b990cdbb7c3e6f9217da09dbe251372.tar.xz
seitan-b46f5dba8b990cdbb7c3e6f9217da09dbe251372.tar.zst
seitan-b46f5dba8b990cdbb7c3e6f9217da09dbe251372.zip
test: fix arguments and offsets
-rw-r--r--tests/unit/test_operations.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/unit/test_operations.c b/tests/unit/test_operations.c
index 2d1a6a9..3a6de8a 100644
--- a/tests/unit/test_operations.c
+++ b/tests/unit/test_operations.c
@@ -84,7 +84,7 @@ static int target()
}
at->ret = syscall(at->nr, at->args[0], at->args[1], at->args[2],
- at->args[3], at->args[4], at->args[5], at->args[5]);
+ at->args[3], at->args[4], at->args[5]);
at->err = errno;
if (at->check_fd)
read(pipefd[0], &buf, 1);
@@ -232,9 +232,9 @@ void setup_target_connect()
MAP_SHARED | MAP_ANONYMOUS, -1, 0);
at->check_fd = false;
at->nr = __NR_connect;
- at->args[0] = &fd;
- at->args[1] = &addr;
- at->args[2] = &len;
+ at->args[0] = (void *)(long)fd;
+ at->args[1] = (void *)&addr;
+ at->args[2] = (void *)(long)len;
setup();
}
@@ -426,8 +426,9 @@ START_TEST(test_op_copy)
(struct copy_arg){ .args_off = sizeof(int) / sizeof(uint16_t),
.type = REFERENCE,
.size = sizeof(struct sockaddr_un) };
- o->args[2] = (struct copy_arg){ .args_off = o->args[1].args_off /
- sizeof(uint16_t),
+ o->args[2] = (struct copy_arg){ .args_off = o->args[1].args_off +
+ sizeof(struct sockaddr_un) /
+ sizeof(uint16_t),
.type = IMMEDIATE,
.size = sizeof(socklen_t) };
ret = do_operations(&tmp_data, operations, &req,