xref: /third_party/rust/crates/rustix/tests/io/error.rs
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/rust/crates/rustix/tests/io/
1b8a62b91Sopenharmony_ci#[test]
2b8a62b91Sopenharmony_cifn test_error() {
3b8a62b91Sopenharmony_ci    assert_eq!(
4b8a62b91Sopenharmony_ci        rustix::io::Errno::INVAL,
5b8a62b91Sopenharmony_ci        rustix::io::Errno::from_raw_os_error(rustix::io::Errno::INVAL.raw_os_error())
6b8a62b91Sopenharmony_ci    );
7b8a62b91Sopenharmony_ci    #[cfg(not(windows))]
8b8a62b91Sopenharmony_ci    assert_eq!(rustix::io::Errno::INVAL.raw_os_error(), libc::EINVAL);
9b8a62b91Sopenharmony_ci    #[cfg(windows)]
10b8a62b91Sopenharmony_ci    assert_eq!(
11b8a62b91Sopenharmony_ci        rustix::io::Errno::INVAL.raw_os_error(),
12b8a62b91Sopenharmony_ci        windows_sys::Win32::Networking::WinSock::WSAEINVAL
13b8a62b91Sopenharmony_ci    );
14b8a62b91Sopenharmony_ci}
15

Indexes created Thu Nov 07 10:32:03 CST 2024