File tree 1 file changed +23
-0
lines changed
1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -122,6 +122,29 @@ ZTEST(timer, test_timer_overrun)
122
122
zassert_equal (timer_getoverrun (timerid ), 4 , "Number of overruns is incorrect" );
123
123
}
124
124
125
+ ZTEST (timer , test_one_shot__SIGEV_SIGNAL )
126
+ {
127
+ struct sigevent sig = {0 };
128
+ struct itimerspec value ;
129
+
130
+ exp_count = 0 ;
131
+ sig .sigev_notify = SIGEV_SIGNAL ;
132
+ sig .sigev_notify_function = handler ;
133
+ sig .sigev_value .sival_int = TEST_SIGNAL_VAL ;
134
+
135
+ zassert_ok (timer_create (CLOCK_MONOTONIC , & sig , & timerid ));
136
+
137
+ /*Set the timer to expire only once*/
138
+ value .it_interval .tv_sec = 0 ;
139
+ value .it_interval .tv_nsec = 0 ;
140
+ value .it_value .tv_sec = 0 ;
141
+ value .it_value .tv_nsec = 100 * NSEC_PER_MSEC ;
142
+ zassert_ok (timer_settime (timerid , 0 , & value , NULL ));
143
+ k_sleep (K_MSEC (300 ));
144
+
145
+ zassert_equal (exp_count , 1 , "Number of expiry is incorrect" );
146
+ }
147
+
125
148
static void after (void * arg )
126
149
{
127
150
ARG_UNUSED (arg );
You can’t perform that action at this time.
0 commit comments