linux: test that the return code, in the error case, has the right sign

This commit is contained in:
Jorge Aparicio 2017-01-13 09:29:31 -05:00
parent b69140b8a9
commit 94ea6388e1

View file

@ -10,6 +10,17 @@
#[macro_use] #[macro_use]
extern crate sc; extern crate sc;
#[cfg(target_os = "linux")]
#[test]
fn ebadf() {
static MESSAGE: &'static str = "Hello, world!";
unsafe {
assert_eq!(syscall!(WRITE, 4, MESSAGE.as_ptr(), MESSAGE.len()) as isize,
-9)
}
}
// getpid() is POSIX but that doesn't guarantee it's a system call. // getpid() is POSIX but that doesn't guarantee it's a system call.
#[cfg(any(target_os = "linux", target_os = "freebsd"))] #[cfg(any(target_os = "linux", target_os = "freebsd"))]
#[test] #[test]