From 45d8beea46ec06ce52c512c8de5976cff85b67a2 Mon Sep 17 00:00:00 2001 From: Philipp Matthias Schaefer Date: Mon, 24 Oct 2016 21:03:30 +0200 Subject: Make signal argument to kill optional --- test/sys/mod.rs | 1 + test/sys/test_signal.rs | 7 +++++++ test/sys/test_wait.rs | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 test/sys/test_signal.rs (limited to 'test/sys') 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 -- cgit v1.2.3