This PR updates the ut_lind_fs_mmap_zerolen test to correctly handle the case where mmap_syscall is passed a length of 0. Passing 0 as the length to mmap should result in an invalid argument error (EINVAL). Previously, the test directly compared the result of mmap_syscall with -(Errno::EINVAL as i32), which was incorrect. Now, the test checks for mmap_syscall returning -1 and verifies that errno is set to EINVAL.
Changes:
Modified the test to assert that mmap_syscall returns -1 upon failure due to the zero-length argument.
Added checks to verify that errno is set to EINVAL, which indicates the invalid argument error for passing a zero-length value to mmap.
Type of change
[x] Bug fix (non-breaking change which fixes an issue)
How Has This Been Tested?
cargo test ut_lind_fs_mmap_zerolen
Checklist:
[x] My code follows the style guidelines of this project
[x] I have commented my code, particularly in hard-to-understand areas
[x] My changes generate no new warnings
[x] I have added tests that prove my fix is effective or that my feature works
[x] Any dependent changes have been added to a pull request and/or merged in other modules (native-client, lind-glibc, lind-project)
Description
Fixes # (issue)
This PR updates the
ut_lind_fs_mmap_zerolen
test to correctly handle the case wheremmap_syscall
is passed a length of0
. Passing0
as the length tommap
should result in an invalid argument error (EINVAL
). Previously, the test directly compared the result ofmmap_syscall
with-(Errno::EINVAL as i32)
, which was incorrect. Now, the test checks formmap_syscall
returning-1
and verifies thaterrno
is set toEINVAL
.Changes:
mmap_syscall
returns-1
upon failure due to the zero-length argument.errno
is set toEINVAL
, which indicates the invalid argument error for passing a zero-length value tommap
.Type of change
How Has This Been Tested?
cargo test ut_lind_fs_mmap_zerolen
Checklist: