diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/sys/mod.rs | 1 | ||||
-rw-r--r-- | test/sys/test_signal.rs | 7 | ||||
-rw-r--r-- | test/sys/test_wait.rs | 2 |
3 files changed, 9 insertions, 1 deletions
diff --git a/test/sys/mod.rs b/test/sys/mod.rs index a5f3351d..6176eb32 100644 --- a/test/sys/mod.rs +++ b/test/sys/mod.rs @@ -1,3 +1,4 @@ +mod test_signal; mod test_socket; mod test_sockopt; mod test_termios; diff --git a/test/sys/test_signal.rs b/test/sys/test_signal.rs new file mode 100644 index 00000000..4084a0da --- /dev/null +++ b/test/sys/test_signal.rs @@ -0,0 +1,7 @@ +use nix::unistd::*; +use nix::sys::signal::*; + +#[test] +fn test_kill_none() { + kill(getpid(), None).ok().expect("Should be able to send signal to myself."); +} diff --git a/test/sys/test_wait.rs b/test/sys/test_wait.rs index c2112bac..d8ac94e4 100644 --- a/test/sys/test_wait.rs +++ b/test/sys/test_wait.rs @@ -9,7 +9,7 @@ fn test_wait_signal() { match fork() { Ok(Child) => pause().unwrap_or(()), Ok(Parent { child }) => { - kill(child, SIGKILL).ok().expect("Error: Kill Failed"); + kill(child, Some(SIGKILL)).ok().expect("Error: Kill Failed"); assert_eq!(waitpid(child, None), Ok(WaitStatus::Signaled(child, SIGKILL, false))); }, // panic, fork should never fail unless there is a serious problem with the OS |