diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/helpers/c/main.c | 4 | ||||
| -rw-r--r-- | tests/lib/test_heavy_thread.c | 4 | ||||
| -rw-r--r-- | tests/lib/test_timer_correctness.c | 4 | ||||
| -rw-r--r-- | tests/lib/test_timer_performance.c | 11 |
4 files changed, 14 insertions, 9 deletions
diff --git a/tests/helpers/c/main.c b/tests/helpers/c/main.c index b3e6e706ff..e422c7e621 100644 --- a/tests/helpers/c/main.c +++ b/tests/helpers/c/main.c @@ -59,14 +59,14 @@ test_timer (struct thread *thread) int *count = THREAD_ARG(thread); printf ("run %d of timer\n", (*count)++); - thread_add_timer (master, test_timer, count, 5); + thread_add_timer(master, test_timer, count, 5, NULL); return 0; } static void test_timer_init() { - thread_add_timer (master, test_timer, &timer_count, 10); + thread_add_timer(master, test_timer, &timer_count, 10, NULL); } static void diff --git a/tests/lib/test_heavy_thread.c b/tests/lib/test_heavy_thread.c index c43fa76c0e..57f0a6070a 100644 --- a/tests/lib/test_heavy_thread.c +++ b/tests/lib/test_heavy_thread.c @@ -91,7 +91,7 @@ clear_something (struct thread *thread) ws->i++; if (thread_should_yield(thread)) { - thread_add_background(master, clear_something, ws, 0); + thread_add_background(master, clear_something, ws, 0, NULL); return 0; } } @@ -135,7 +135,7 @@ DEFUN (clear_foo, ws->vty = vty; ws->i = ITERS_FIRST; - thread_add_background(master, clear_something, ws, 0); + thread_add_background(master, clear_something, ws, 0, NULL); return CMD_SUCCESS; } diff --git a/tests/lib/test_timer_correctness.c b/tests/lib/test_timer_correctness.c index e523929be1..b0643b907b 100644 --- a/tests/lib/test_timer_correctness.c +++ b/tests/lib/test_timer_correctness.c @@ -139,7 +139,9 @@ int main(int argc, char **argv) /* Schedule timers to expire in 0..5 seconds */ interval_msec = prng_rand(prng) % 5000; arg = XMALLOC(MTYPE_TMP, TIMESTR_LEN + 1); - timers[i] = thread_add_timer_msec(master, timer_func, arg, interval_msec); + timers[i] = NULL; + thread_add_timer_msec(master, timer_func, arg, interval_msec, + &timers[i]); ret = snprintf(arg, TIMESTR_LEN + 1, "%lld.%06lld", (long long)timers[i]->u.sands.tv_sec, (long long)timers[i]->u.sands.tv_usec); diff --git a/tests/lib/test_timer_performance.c b/tests/lib/test_timer_performance.c index a7d09beecc..da0355f660 100644 --- a/tests/lib/test_timer_performance.c +++ b/tests/lib/test_timer_performance.c @@ -56,8 +56,10 @@ int main(int argc, char **argv) /* create thread structures so they won't be allocated during the * time measurement */ - for (i = 0; i < SCHEDULE_TIMERS; i++) - timers[i] = thread_add_timer_msec(master, dummy_func, NULL, 0); + for (i = 0; i < SCHEDULE_TIMERS; i++) { + timers[i] = NULL; + thread_add_timer_msec(master, dummy_func, NULL, 0, &timers[i]); + } for (i = 0; i < SCHEDULE_TIMERS; i++) thread_cancel(timers[i]); @@ -68,8 +70,9 @@ int main(int argc, char **argv) long interval_msec; interval_msec = prng_rand(prng) % (100 * SCHEDULE_TIMERS); - timers[i] = thread_add_timer_msec(master, dummy_func, - NULL, interval_msec); + timers[i] = NULL; + thread_add_timer_msec(master, dummy_func, NULL, interval_msec, + &timers[i]); } monotime(&tv_lap); |
