diff options
author | Bryant Mairs <bryantmairs@google.com> | 2017-12-03 13:31:10 -0800 |
---|---|---|
committer | Bryant Mairs <bryantmairs@google.com> | 2017-12-05 07:49:09 -0800 |
commit | c1a02f32073c0a87bb91fb24808e3c03fd7517d7 (patch) | |
tree | c87b5bfbf28f93193e4048134eebfb7a6710746c | |
parent | 4013fa48487ea9ae917932488858b95d626c611e (diff) | |
download | nix-c1a02f32073c0a87bb91fb24808e3c03fd7517d7.zip |
Remove redundant constant tests
Now that these constants are verified within libc,
these tests are no longer necessary.
-rw-r--r-- | src/errno.rs | 320 |
1 files changed, 0 insertions, 320 deletions
diff --git a/src/errno.rs b/src/errno.rs index c3f33cb3..67171795 100644 --- a/src/errno.rs +++ b/src/errno.rs @@ -1906,323 +1906,3 @@ mod consts { } } } - - -#[cfg(test)] -mod test { - use super::Errno::*; - use nixtest::assert_const_eq; - use libc::c_int; - - macro_rules! check_errno { - ($($errno:ident),+) => {{ - $(assert_const_eq(stringify!($errno), $errno as c_int);)+ - }}; - } - - #[test] - pub fn test_errno_values() { - check_errno!( - EPERM, - ENOENT, - ESRCH, - EINTR, - EIO, - ENXIO, - E2BIG, - ENOEXEC, - EBADF, - ECHILD, - EAGAIN, - ENOMEM, - EACCES, - EFAULT, - ENOTBLK, - EBUSY, - EEXIST, - EXDEV, - ENODEV, - ENOTDIR, - EISDIR, - EINVAL, - ENFILE, - EMFILE, - ENOTTY, - ETXTBSY, - EFBIG, - ENOSPC, - ESPIPE, - EROFS, - EMLINK, - EPIPE, - EDOM, - ERANGE, - EDEADLK, - ENAMETOOLONG, - ENOLCK, - ENOSYS, - ENOTEMPTY, - ELOOP, - ENOMSG, - EIDRM); - - check_errno!( - EINPROGRESS, - EALREADY, - ENOTSOCK, - EDESTADDRREQ, - EMSGSIZE, - EPROTOTYPE, - ENOPROTOOPT, - EPROTONOSUPPORT, - ESOCKTNOSUPPORT, - EPFNOSUPPORT, - EAFNOSUPPORT, - EADDRINUSE, - EADDRNOTAVAIL, - ENETDOWN, - ENETUNREACH, - ENETRESET, - ECONNABORTED, - ECONNRESET, - ENOBUFS, - EISCONN, - ENOTCONN, - ESHUTDOWN, - ETOOMANYREFS, - ETIMEDOUT, - ECONNREFUSED, - EHOSTDOWN, - EHOSTUNREACH); - } - - #[test] - #[cfg(any(target_os = "linux", target_os = "android"))] - pub fn test_linux_errnos() { - check_errno!( - ECHRNG, - EL2NSYNC, - EL3HLT, - EL3RST, - ELNRNG, - EUNATCH, - ENOCSI, - EL2HLT, - EBADE, - EBADR, - EXFULL, - ENOANO, - EBADRQC, - EBADSLT, - EBFONT, - ENOSTR, - ENODATA, - ETIME, - ENOSR, - ENONET, - ENOPKG, - EREMOTE, - ENOLINK, - EADV, - ESRMNT, - ECOMM, - EPROTO, - EMULTIHOP, - EDOTDOT, - EBADMSG, - EOVERFLOW, - ENOTUNIQ, - EBADFD, - EREMCHG, - ELIBACC, - ELIBBAD, - ELIBSCN, - ELIBMAX, - ELIBEXEC, - EILSEQ, - ERESTART, - ESTRPIPE, - EUSERS, - EOPNOTSUPP, - ESTALE, - EUCLEAN, - ENOTNAM, - ENAVAIL, - EISNAM, - EREMOTEIO, - EDQUOT, - ENOMEDIUM, - EMEDIUMTYPE, - ECANCELED, - ENOKEY, - EKEYEXPIRED, - EKEYREVOKED, - EKEYREJECTED, - EOWNERDEAD, - ENOTRECOVERABLE); - } - - #[test] - #[cfg(all(target_os = "linux", not(target_arch = "mips")))] - pub fn test_linux_not_android_errnos() { - check_errno!( - ERFKILL /*, - EHWPOISON */); - } - - #[test] - #[cfg(target_os = "freebsd")] - pub fn test_freebsd_errnos() { - check_errno!( - EDOOFUS, - EMULTIHOP, - ENOLINK, - ENOTCAPABLE, - ECAPMODE, - ENEEDAUTH, - EOVERFLOW, - EILSEQ, - ENOATTR, - EBADMSG, - EPROTO, - ENOTRECOVERABLE, - EOWNERDEAD, - ENOTSUP, - EPROCLIM, - EUSERS, - EDQUOT, - ESTALE, - EREMOTE, - EBADRPC, - ERPCMISMATCH, - EPROGUNAVAIL, - EPROGMISMATCH, - EPROCUNAVAIL, - EAUTH); - } - - #[test] - #[cfg(target_os = "dragonfly")] - pub fn test_dragonfly_errnos() { - check_errno!( - EDOOFUS, - EMULTIHOP, - ENOLINK, - ENEEDAUTH, - EOVERFLOW, - EILSEQ, - ENOATTR, - EBADMSG, - EPROTO, - ENOTSUP, - EPROCLIM, - EUSERS, - EDQUOT, - ESTALE, - EREMOTE, - EBADRPC, - ERPCMISMATCH, - EPROGUNAVAIL, - EPROGMISMATCH, - EPROCUNAVAIL, - EAUTH); - } - - #[test] - #[cfg(target_os = "openbsd")] - pub fn test_openbsd_errnos() { - check_errno!( - EADDRINUSE, - EADDRNOTAVAIL, - EAFNOSUPPORT, - EALREADY, - EAUTH, - EBADRPC, - ECANCELED, - ECONNABORTED, - ECONNREFUSED, - ECONNRESET, - EDESTADDRREQ, - EDQUOT, - EFTYPE, - EHOSTDOWN, - EHOSTUNREACH, - EILSEQ, - EINPROGRESS, - EIPSEC, - EISCONN, - EMEDIUMTYPE, - EMSGSIZE, - ENEEDAUTH, - ENETDOWN, - ENETRESET, - ENETUNREACH, - ENOATTR, - ENOBUFS, - ENOMEDIUM, - ENOPROTOOPT, - ENOTCONN, - ENOTSOCK, - ENOTSUP, - EOPNOTSUPP, - EOVERFLOW, - EPFNOSUPPORT, - EPROCLIM, - EPROCUNAVAIL, - EPROGMISMATCH, - EPROGUNAVAIL, - EPROTONOSUPPORT, - EPROTOTYPE, - EREMOTE, - ESHUTDOWN, - ESOCKTNOSUPPORT, - ESTALE, - ETIMEDOUT, - ETOOMANYREFS, - EUSERS); - } - - #[test] - #[cfg(any(target_os = "macos", target_os = "ios"))] - pub fn test_darwin_errnos() { - check_errno!( - ENOTSUP, - EPROCLIM, - EUSERS, - EDQUOT, - ESTALE, - EREMOTE, - EBADRPC, - ERPCMISMATCH, - EPROGUNAVAIL, - EPROGMISMATCH, - EPROCUNAVAIL, - EFTYPE, - EAUTH, - ENEEDAUTH, - EPWROFF, - EDEVERR, - EOVERFLOW, - EBADEXEC, - EBADARCH, - ESHLIBVERS, - EBADMACHO, - ECANCELED, - EILSEQ, - ENOATTR, - EBADMSG, - EMULTIHOP, - ENODATA, - ENOLINK, - ENOSR, - ENOSTR, - EPROTO, - ETIME, - EOPNOTSUPP, - ENOPOLICY, - ENOTRECOVERABLE, - EOWNERDEAD, - EQFULL - ); - } -} |