summaryrefslogtreecommitdiff
path: root/test/test_time.rs
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_time.rs')
-rw-r--r--test/test_time.rs15
1 files changed, 8 insertions, 7 deletions
diff --git a/test/test_time.rs b/test/test_time.rs
index dc307e57..3e8af653 100644
--- a/test/test_time.rs
+++ b/test/test_time.rs
@@ -11,12 +11,12 @@ use nix::time::{clock_gettime, ClockId};
#[cfg(not(target_os = "redox"))]
#[test]
pub fn test_clock_getres() {
- assert!(nix::time::clock_getres(ClockId::CLOCK_REALTIME).is_ok());
+ nix::time::clock_getres(ClockId::CLOCK_REALTIME).expect("assertion failed");
}
#[test]
pub fn test_clock_gettime() {
- assert!(clock_gettime(ClockId::CLOCK_REALTIME).is_ok());
+ clock_gettime(ClockId::CLOCK_REALTIME).expect("assertion failed");
}
#[cfg(any(
@@ -29,18 +29,18 @@ pub fn test_clock_gettime() {
#[test]
pub fn test_clock_getcpuclockid() {
let clock_id = clock_getcpuclockid(nix::unistd::Pid::this()).unwrap();
- assert!(clock_gettime(clock_id).is_ok());
+ clock_gettime(clock_id).expect("assert failed");
}
#[cfg(not(target_os = "redox"))]
#[test]
pub fn test_clock_id_res() {
- assert!(ClockId::CLOCK_REALTIME.res().is_ok());
+ ClockId::CLOCK_REALTIME.res().expect("assert failed");
}
#[test]
pub fn test_clock_id_now() {
- assert!(ClockId::CLOCK_REALTIME.now().is_ok());
+ ClockId::CLOCK_REALTIME.now().expect("assert failed");
}
#[cfg(any(
@@ -52,7 +52,8 @@ pub fn test_clock_id_now() {
))]
#[test]
pub fn test_clock_id_pid_cpu_clock_id() {
- assert!(ClockId::pid_cpu_clock_id(nix::unistd::Pid::this())
+ ClockId::pid_cpu_clock_id(nix::unistd::Pid::this())
.map(ClockId::now)
- .is_ok());
+ .expect("assert failed")
+ .expect("assert failed");
}