-
Notifications
You must be signed in to change notification settings - Fork 406
Add libc direct tests for (get/set/unset)env functions #4679
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
base: master
Are you sure you want to change the base?
Conversation
|
Thank you for contributing to Miri! A reviewer will take a look at your PR, typically within a week or two. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I left some minor comments.
| @@ -0,0 +1,98 @@ | |||
| //@ignore-target: windows | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| //@ignore-target: windows | |
| //@ignore-target: windows # No libc |
| // PATH should exist and not be null | ||
| let s = unsafe { libc::getenv(b"PATH\0".as_ptr().cast()) }; | ||
| assert!(!s.is_null()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check MIRI_ENV_VAR_TEST instead, which is set by the test harness so it should always have the value "0".
| #[path = "../../utils/mod.rs"] | ||
| mod utils; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not seem to be used?
This PR adds tests for the
getenv,setenvandunsetenvfunctions directly through the libc api. Related to #3179