Skip to content

Commit 65ae7db

Browse files
committed
test(time_misc): test the error behavior caused by an invalid timeout
1 parent ab52299 commit 65ae7db

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/constance_test_suite/src/kernel_tests/time_misc.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,15 @@ fn task_body<System: Kernel, D: Driver<App<System>>>(_: usize) {
6868
log::trace!("time = {:?} (expected >= {:?})", now4_got, now4);
6969
assert!(now4_got.as_micros() >= now4.as_micros());
7070

71+
// Out-of-range duration
72+
assert_eq!(
73+
System::sleep(Duration::from_micros(-1)),
74+
Err(constance::kernel::SleepError::BadParam)
75+
);
76+
assert_eq!(
77+
System::sleep(Duration::MIN),
78+
Err(constance::kernel::SleepError::BadParam)
79+
);
80+
7181
D::success();
7282
}

0 commit comments

Comments
 (0)