Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: test case ut_lind_fs_mmap_zerolen #70

Merged
merged 1 commit into from
Oct 24, 2024

Conversation

ChinmayShringi
Copy link
Contributor

@ChinmayShringi ChinmayShringi commented Oct 24, 2024

Description

Fixes # (issue)

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

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • cargo test ut_lind_fs_mmap_zerolen

Checklist:

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Any dependent changes have been added to a pull request and/or merged in other modules (native-client, lind-glibc, lind-project)

@JustinCappos JustinCappos merged commit 61082c7 into main Oct 24, 2024
1 check failed
@Yaxuan-w Yaxuan-w deleted the fix-ut-lind-fs-mmap-zerolen branch October 25, 2024 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants