summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/sys/signal.rs6
-rw-r--r--src/sys/signalfd.rs9
-rw-r--r--src/sys/termios.rs4
3 files changed, 11 insertions, 8 deletions
diff --git a/src/sys/signal.rs b/src/sys/signal.rs
index 4a468b62..0da9c74a 100644
--- a/src/sys/signal.rs
+++ b/src/sys/signal.rs
@@ -1189,7 +1189,7 @@ mod tests {
let mut test_mask = prev_mask;
test_mask.add(SIGUSR1);
- assert!(test_mask.thread_set_mask().is_ok());
+ test_mask.thread_set_mask().expect("assertion failed");
let new_mask =
SigSet::thread_get_mask().expect("Failed to get new mask!");
@@ -1211,7 +1211,7 @@ mod tests {
let mut mask = SigSet::empty();
mask.add(SIGUSR1);
- assert!(mask.thread_block().is_ok());
+ mask.thread_block().expect("assertion failed");
assert!(SigSet::thread_get_mask().unwrap().contains(SIGUSR1));
})
@@ -1226,7 +1226,7 @@ mod tests {
let mut mask = SigSet::empty();
mask.add(SIGUSR1);
- assert!(mask.thread_unblock().is_ok());
+ mask.thread_unblock().expect("assertion failed");
assert!(!SigSet::thread_get_mask().unwrap().contains(SIGUSR1));
})
diff --git a/src/sys/signalfd.rs b/src/sys/signalfd.rs
index bc4a4522..3d82b5ba 100644
--- a/src/sys/signalfd.rs
+++ b/src/sys/signalfd.rs
@@ -148,14 +148,17 @@ mod tests {
fn create_signalfd() {
let mask = SigSet::empty();
let fd = SignalFd::new(&mask);
- assert!(fd.is_ok());
+ fd.expect("assert failed");
}
#[test]
fn create_signalfd_with_opts() {
let mask = SigSet::empty();
- let fd = SignalFd::with_flags(&mask, SfdFlags::SFD_CLOEXEC | SfdFlags::SFD_NONBLOCK);
- assert!(fd.is_ok());
+ let fd = SignalFd::with_flags(
+ &mask,
+ SfdFlags::SFD_CLOEXEC | SfdFlags::SFD_NONBLOCK,
+ );
+ fd.expect("assert failed");
}
#[test]
diff --git a/src/sys/termios.rs b/src/sys/termios.rs
index 2e1b53d7..feb52c0a 100644
--- a/src/sys/termios.rs
+++ b/src/sys/termios.rs
@@ -1107,8 +1107,8 @@ mod test {
fn try_from() {
assert_eq!(Ok(BaudRate::B0), BaudRate::try_from(libc::B0));
#[cfg(not(target_os = "haiku"))]
- assert!(BaudRate::try_from(999999999).is_err());
+ BaudRate::try_from(999999999).expect_err("assertion failed");
#[cfg(target_os = "haiku")]
- assert!(BaudRate::try_from(99).is_err());
+ BaudRate::try_from(99).expect_err("assertion failed");
}
}