1 //! Compare libc's SO_EE_OFFENDER function against the actual C macro 2 3 extern crate libc; 4 5 #[cfg(any(target_os = "linux", target_os = "android"))] 6 mod t { 7 use libc::{self, sock_extended_err, sockaddr}; 8 9 extern "C" { so_ee_offender(ee: *const sock_extended_err) -> *mut sockaddr10 pub fn so_ee_offender(ee: *const sock_extended_err) -> *mut sockaddr; 11 } 12 13 #[test] test_cmsg_data()14 fn test_cmsg_data() { 15 for l in 0..128 { 16 let ee = l as *const sock_extended_err; 17 unsafe { 18 assert_eq!(libc::SO_EE_OFFENDER(ee), so_ee_offender(ee)); 19 } 20 } 21 } 22 } 23