summaryrefslogtreecommitdiffstats
path: root/vendor/rustix/tests/io/error.rs
blob: 128d3b59a5301bea982ca90becf80566d2d9e039 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#[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
    );
}