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:
Robert Schmidt
2024-09-06 10:20:08 +02:00
parent 8d6b6676c5
commit ea171c75c0
8 changed files with 31 additions and 31 deletions
+4 -4
View File
@@ -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));
}