@@ -19,14 +19,28 @@ use {
1919fn test_invalid_nanosleep ( ) {
2020 match nanosleep ( & Timespec {
2121 tv_sec : 0 ,
22- tv_nsec : 1000000000 ,
22+ tv_nsec : 1_000_000_000 ,
2323 } ) {
2424 NanosleepRelativeResult :: Err ( io:: Errno :: INVAL ) => ( ) ,
2525 otherwise => panic ! ( "unexpected resut: {:?}" , otherwise) ,
2626 }
2727 match nanosleep ( & Timespec {
2828 tv_sec : 0 ,
29- tv_nsec : -1 as _ ,
29+ tv_nsec : !0 ,
30+ } ) {
31+ NanosleepRelativeResult :: Err ( io:: Errno :: INVAL ) => ( ) ,
32+ otherwise => panic ! ( "unexpected resut: {:?}" , otherwise) ,
33+ }
34+ match nanosleep ( & Timespec {
35+ tv_sec : !0 ,
36+ tv_nsec : 1_000_000_000 ,
37+ } ) {
38+ NanosleepRelativeResult :: Err ( io:: Errno :: INVAL ) => ( ) ,
39+ otherwise => panic ! ( "unexpected resut: {:?}" , otherwise) ,
40+ }
41+ match nanosleep ( & Timespec {
42+ tv_sec : !0 ,
43+ tv_nsec : !0 ,
3044 } ) {
3145 NanosleepRelativeResult :: Err ( io:: Errno :: INVAL ) => ( ) ,
3246 otherwise => panic ! ( "unexpected resut: {:?}" , otherwise) ,
@@ -58,7 +72,27 @@ fn test_invalid_nanosleep_absolute() {
5872 ClockId :: Monotonic ,
5973 & Timespec {
6074 tv_sec : 0 ,
61- tv_nsec : -1 as _ ,
75+ tv_nsec : !0 ,
76+ } ,
77+ ) {
78+ Err ( io:: Errno :: INVAL ) => ( ) ,
79+ otherwise => panic ! ( "unexpected resut: {:?}" , otherwise) ,
80+ }
81+ match clock_nanosleep_absolute (
82+ ClockId :: Monotonic ,
83+ & Timespec {
84+ tv_sec : !0 ,
85+ tv_nsec : 1_000_000_000 ,
86+ } ,
87+ ) {
88+ Err ( io:: Errno :: INVAL ) => ( ) ,
89+ otherwise => panic ! ( "unexpected resut: {:?}" , otherwise) ,
90+ }
91+ match clock_nanosleep_absolute (
92+ ClockId :: Monotonic ,
93+ & Timespec {
94+ tv_sec : !0 ,
95+ tv_nsec : !0 ,
6296 } ,
6397 ) {
6498 Err ( io:: Errno :: INVAL ) => ( ) ,
@@ -81,7 +115,7 @@ fn test_invalid_nanosleep_relative() {
81115 ClockId :: Monotonic ,
82116 & Timespec {
83117 tv_sec : 0 ,
84- tv_nsec : 1000000000 ,
118+ tv_nsec : 1_000_000_000 ,
85119 } ,
86120 ) {
87121 NanosleepRelativeResult :: Err ( io:: Errno :: INVAL ) => ( ) ,
@@ -91,7 +125,27 @@ fn test_invalid_nanosleep_relative() {
91125 ClockId :: Monotonic ,
92126 & Timespec {
93127 tv_sec : 0 ,
94- tv_nsec : -1 as _ ,
128+ tv_nsec : !0 ,
129+ } ,
130+ ) {
131+ NanosleepRelativeResult :: Err ( io:: Errno :: INVAL ) => ( ) ,
132+ otherwise => panic ! ( "unexpected resut: {:?}" , otherwise) ,
133+ }
134+ match clock_nanosleep_relative (
135+ ClockId :: Monotonic ,
136+ & Timespec {
137+ tv_sec : !0 ,
138+ tv_nsec : 1_000_000_000 ,
139+ } ,
140+ ) {
141+ NanosleepRelativeResult :: Err ( io:: Errno :: INVAL ) => ( ) ,
142+ otherwise => panic ! ( "unexpected resut: {:?}" , otherwise) ,
143+ }
144+ match clock_nanosleep_relative (
145+ ClockId :: Monotonic ,
146+ & Timespec {
147+ tv_sec : !0 ,
148+ tv_nsec : !0 ,
95149 } ,
96150 ) {
97151 NanosleepRelativeResult :: Err ( io:: Errno :: INVAL ) => ( ) ,
0 commit comments