Don't use TIMER_ABSTIME in time_test.
If TIMER_ABSTIME is used in timer_settime(), the timer is always fired immediately, which is not the intent of the tests. Change-Id: I76047dbeb2bdded272ee6d028630b53bfd7d8514
This commit is contained in:
parent
547fa54e6d
commit
d1ade7ce02
|
@ -166,7 +166,7 @@ void SetTime(timer_t t, time_t value_s, time_t value_ns, time_t interval_s, time
|
|||
ts.it_value.tv_nsec = value_ns;
|
||||
ts.it_interval.tv_sec = interval_s;
|
||||
ts.it_interval.tv_nsec = interval_ns;
|
||||
ASSERT_EQ(0, timer_settime(t, TIMER_ABSTIME, &ts, NULL));
|
||||
ASSERT_EQ(0, timer_settime(t, 0, &ts, NULL));
|
||||
}
|
||||
|
||||
static void NoOpNotifyFunction(sigval_t) {
|
||||
|
@ -223,7 +223,7 @@ TEST(time, timer_create_SIGEV_SIGNAL) {
|
|||
ts.it_value.tv_nsec = 1;
|
||||
ts.it_interval.tv_sec = 0;
|
||||
ts.it_interval.tv_nsec = 0;
|
||||
ASSERT_EQ(0, timer_settime(timer_id, TIMER_ABSTIME, &ts, NULL));
|
||||
ASSERT_EQ(0, timer_settime(timer_id, 0, &ts, NULL));
|
||||
|
||||
usleep(500000);
|
||||
ASSERT_EQ(1, timer_create_SIGEV_SIGNAL_signal_handler_invocation_count);
|
||||
|
|
Loading…
Reference in New Issue