nr_timer: consistently pass by ref, rename to nr_timer_is_active()
Pass consistently the NR_timer_t object through a pointer. Since we have to modify all occurrences of is_nr_timer_active(), we use that occasion and rename that function to nr_timer_is_active() to make it consistent with all other functions, starting with nr_timer.
This commit is contained in:
@@ -29,13 +29,13 @@ TEST(nr_common, nr_timer) {
|
||||
NR_timer_t timer;
|
||||
nr_timer_setup(&timer, 10, 1);
|
||||
nr_timer_start(&timer);
|
||||
EXPECT_TRUE(is_nr_timer_active(timer));
|
||||
EXPECT_FALSE(nr_timer_expired(timer));
|
||||
EXPECT_TRUE(nr_timer_is_active(&timer));
|
||||
EXPECT_FALSE(nr_timer_expired(&timer));
|
||||
for (auto i = 0; i < 10; i++) {
|
||||
nr_timer_tick(&timer);
|
||||
}
|
||||
EXPECT_FALSE(is_nr_timer_active(timer));
|
||||
EXPECT_TRUE(nr_timer_expired(timer));
|
||||
EXPECT_FALSE(nr_timer_is_active(&timer));
|
||||
EXPECT_TRUE(nr_timer_expired(&timer));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user