summaryrefslogtreecommitdiff
path: root/test/sys/test_timerfd.rs
diff options
context:
space:
mode:
Diffstat (limited to 'test/sys/test_timerfd.rs')
-rw-r--r--test/sys/test_timerfd.rs18
1 files changed, 13 insertions, 5 deletions
diff --git a/test/sys/test_timerfd.rs b/test/sys/test_timerfd.rs
index 24fb2ac0..927cc70d 100644
--- a/test/sys/test_timerfd.rs
+++ b/test/sys/test_timerfd.rs
@@ -1,10 +1,13 @@
use nix::sys::time::{TimeSpec, TimeValLike};
-use nix::sys::timerfd::{ClockId, Expiration, TimerFd, TimerFlags, TimerSetTimeFlags};
+use nix::sys::timerfd::{
+ ClockId, Expiration, TimerFd, TimerFlags, TimerSetTimeFlags,
+};
use std::time::Instant;
#[test]
pub fn test_timerfd_oneshot() {
- let timer = TimerFd::new(ClockId::CLOCK_MONOTONIC, TimerFlags::empty()).unwrap();
+ let timer =
+ TimerFd::new(ClockId::CLOCK_MONOTONIC, TimerFlags::empty()).unwrap();
let before = Instant::now();
@@ -23,12 +26,16 @@ pub fn test_timerfd_oneshot() {
#[test]
pub fn test_timerfd_interval() {
- let timer = TimerFd::new(ClockId::CLOCK_MONOTONIC, TimerFlags::empty()).unwrap();
+ let timer =
+ TimerFd::new(ClockId::CLOCK_MONOTONIC, TimerFlags::empty()).unwrap();
let before = Instant::now();
timer
.set(
- Expiration::IntervalDelayed(TimeSpec::seconds(1), TimeSpec::seconds(2)),
+ Expiration::IntervalDelayed(
+ TimeSpec::seconds(1),
+ TimeSpec::seconds(2),
+ ),
TimerSetTimeFlags::empty(),
)
.unwrap();
@@ -46,7 +53,8 @@ pub fn test_timerfd_interval() {
#[test]
pub fn test_timerfd_unset() {
- let timer = TimerFd::new(ClockId::CLOCK_MONOTONIC, TimerFlags::empty()).unwrap();
+ let timer =
+ TimerFd::new(ClockId::CLOCK_MONOTONIC, TimerFlags::empty()).unwrap();
timer
.set(