mirror of
https://github.com/openharmony/third_party_rust_rustix.git
synced 2026-07-23 03:05:51 -04:00
243e8c5197
Fixes #254.
15 lines
418 B
Rust
15 lines
418 B
Rust
#[test]
|
|
fn test_error() {
|
|
assert_eq!(
|
|
rustix::io::Errno::INVAL,
|
|
rustix::io::Errno::from_raw_os_error(rustix::io::Errno::INVAL.raw_os_error())
|
|
);
|
|
#[cfg(not(windows))]
|
|
assert_eq!(rustix::io::Errno::INVAL.raw_os_error(), libc::EINVAL);
|
|
#[cfg(windows)]
|
|
assert_eq!(
|
|
rustix::io::Errno::INVAL.raw_os_error(),
|
|
windows_sys::Win32::Networking::WinSock::WSAEINVAL
|
|
);
|
|
}
|