Skip to content

Commit

Permalink
chore(test/drivers): some small fixes for file_opener and a couple of…
Browse files Browse the repository at this point in the history
… tests.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
  • Loading branch information
FedeDP authored and poiana committed Mar 11, 2024
1 parent d90cb71 commit 5dc692e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions test/drivers/helpers/file_opener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

file_opener::file_opener(const char* filename, int flags, int dirfd)
{
errno = 0;
m_fd = syscall(__NR_openat, dirfd, filename, flags, 0);
// Using the macro that deals with ENOSYS produces a build issue since GTEST_SKIP returns value in a ctor.
_assert_syscall_state(SYSCALL_SUCCESS, "openat", m_fd, NOT_EQUAL, -1);
Expand Down
2 changes: 1 addition & 1 deletion test/drivers/test_suites/syscall_exit_suite/dup3_x.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ TEST(SyscallExit, dup3X)
int32_t new_fd = old_fd;
uint32_t flags = O_CLOEXEC;
int32_t res = syscall(__NR_dup3, old_fd, new_fd, flags);
assert_syscall_state(SYSCALL_FAILURE, "dup3", res);
int64_t errno_value = -errno;
assert_syscall_state(SYSCALL_FAILURE, "dup3", res);

syscall(__NR_close, new_fd);
syscall(__NR_close, res);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ TEST(SyscallExit, newfstatatX_failure)
int flags = AT_NO_AUTOMOUNT | AT_SYMLINK_NOFOLLOW;

int32_t res = syscall(__NR_newfstatat, dirfd, pathname, &buffer, flags);
assert_syscall_state(SYSCALL_FAILURE, "newfstatat", res);
int64_t errno_value = -errno;
assert_syscall_state(SYSCALL_FAILURE, "newfstatat", res);

/*=============================== TRIGGER SYSCALL ===========================*/

Expand Down

0 comments on commit 5dc692e

Please sign in to comment.