From 5e999457689e4dabbc1720ea9ce684ef78286df0 Mon Sep 17 00:00:00 2001 From: Glenn Griffin Date: Mon, 5 Feb 2018 09:30:22 -0800 Subject: Add test for getsid. --- test/test_unistd.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/test_unistd.rs') diff --git a/test/test_unistd.rs b/test/test_unistd.rs index e15fec17..d0db55f6 100644 --- a/test/test_unistd.rs +++ b/test/test_unistd.rs @@ -107,6 +107,14 @@ fn test_getpid() { assert!(ppid > 0); } +#[test] +fn test_getsid() { + let none_sid: ::libc::pid_t = getsid(None).unwrap().into(); + let pid_sid: ::libc::pid_t = getsid(Some(getpid())).unwrap().into(); + assert!(none_sid > 0); + assert!(none_sid == pid_sid); +} + #[cfg(any(target_os = "linux", target_os = "android"))] mod linux_android { use nix::unistd::gettid; -- cgit v1.2.3