Name uc_timers_XXX consistently
This commit is contained in:
+11
-11
@@ -18,13 +18,13 @@ static void timer_test_cb_add(struct UCTimers *timers, struct UCTimer *timer)
|
||||
{
|
||||
struct TimerTest *tt = timer->cookie_ptr;
|
||||
tt->cnt++;
|
||||
uc_timer_add(timers, timer, 10, 0);
|
||||
uc_timers_add(timers, timer, 10, 0);
|
||||
}
|
||||
|
||||
static void timer_test_cb_remove(struct UCTimers *timers, struct UCTimer *timer)
|
||||
{
|
||||
struct UCTimer *timer2 = timer->cookie_ptr;
|
||||
uc_timer_remove(timers, timer2);
|
||||
uc_timers_remove(timers, timer2);
|
||||
}
|
||||
|
||||
static void common_init(struct UCoreSettableClock *clk,
|
||||
@@ -54,7 +54,7 @@ START_TEST (test_timers_simple)
|
||||
|
||||
timer.callback = timer_test_cb;
|
||||
|
||||
uc_timer_add(&timers, &timer, 10, 0);
|
||||
uc_timers_add(&timers, &timer, 10, 0);
|
||||
|
||||
//5 seconds into the future, no timer should fire
|
||||
t += 5;
|
||||
@@ -62,7 +62,7 @@ START_TEST (test_timers_simple)
|
||||
rc = uc_timers_run(&timers);
|
||||
fail_if(rc != 0);
|
||||
fail_if(tt.cnt != 0);
|
||||
fail_if(uc_timer_count(&timers) != 1);
|
||||
fail_if(uc_timers_count(&timers) != 1);
|
||||
|
||||
//10 seconds into the future, our timer should fire
|
||||
t += 5;
|
||||
@@ -77,7 +77,7 @@ START_TEST (test_timers_simple)
|
||||
rc = uc_timers_run(&timers);
|
||||
fail_if(rc != 0);
|
||||
fail_if(tt.cnt != 1);
|
||||
fail_if(uc_timer_count(&timers) != 0);
|
||||
fail_if(uc_timers_count(&timers) != 0);
|
||||
fail_if(uc_timer_running(&timer) != 0);
|
||||
|
||||
END_TEST
|
||||
@@ -94,7 +94,7 @@ START_TEST (test_timers_add_from_callback)
|
||||
|
||||
timer.callback = timer_test_cb_add;
|
||||
|
||||
uc_timer_add(&timers, &timer, 10, 0);
|
||||
uc_timers_add(&timers, &timer, 10, 0);
|
||||
|
||||
//10 seconds into the future, our timer should fire
|
||||
t += 10;
|
||||
@@ -112,7 +112,7 @@ START_TEST (test_timers_add_from_callback)
|
||||
fail_if(tt.cnt != 2);
|
||||
|
||||
fail_if(uc_timer_running(&timer) == 0);
|
||||
fail_if(uc_timer_count(&timers) != 1);
|
||||
fail_if(uc_timers_count(&timers) != 1);
|
||||
|
||||
END_TEST
|
||||
|
||||
@@ -133,10 +133,10 @@ START_TEST (test_timers_remove_from_callback)
|
||||
memset(&timer2, 0, sizeof timer2);
|
||||
timer2.callback = timer_test_cb;
|
||||
|
||||
uc_timer_add(&timers, &timer, 5, 0);
|
||||
uc_timer_add(&timers, &timer2, 10, 0);
|
||||
uc_timers_add(&timers, &timer, 5, 0);
|
||||
uc_timers_add(&timers, &timer2, 10, 0);
|
||||
|
||||
fail_if(uc_timer_count(&timers) != 2);
|
||||
fail_if(uc_timers_count(&timers) != 2);
|
||||
rc = uc_timers_first(&timers, &tv);
|
||||
fail_if(rc != 0);
|
||||
fail_if(tv.tv_sec != TEST_TIMER_START + 5);
|
||||
@@ -152,7 +152,7 @@ START_TEST (test_timers_remove_from_callback)
|
||||
//and our timer2 should be removed, and timer has fired so it
|
||||
//should be removed too
|
||||
|
||||
fail_if(uc_timer_count(&timers) != 0);
|
||||
fail_if(uc_timers_count(&timers) != 0);
|
||||
fail_if(uc_timer_running(&timer) != 0);
|
||||
fail_if(uc_timer_running(&timer2) != 0);
|
||||
rc = uc_timers_first(&timers, &tv);
|
||||
|
||||
Reference in New Issue
Block a user