diff options
author | Holger Freyther <zecke@selfish.org> | 2009-01-04 03:45:13 +0000 |
---|---|---|
committer | Holger Freyther <zecke@selfish.org> | 2009-01-04 03:45:13 +0000 |
commit | 5f234e4f3afba986755f454503037cdd81b346c0 (patch) | |
tree | 3f25d3055a9696486e76bb1322c83e0f7c824ed4 /tests | |
parent | 4668fdaa262181eafef899c82bf119f6344334d2 (diff) |
Add test case that is not registering the timer again
yesterday's crash with the llist_del instead of using del_timer
was due this kind of bug. Add a test case.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/timer/timer_test.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/timer/timer_test.c b/tests/timer/timer_test.c index 4d98aef42..3f5828be2 100644 --- a/tests/timer/timer_test.c +++ b/tests/timer/timer_test.c @@ -35,6 +35,11 @@ static struct timer_list timer_two = { .data = (void*)2, }; +static struct timer_list timer_three = { + .cb = timer_fired, + .data = (void*)3, +}; + static void timer_fired(unsigned long data) { printf("Fired timer: %lu\n", data); @@ -44,6 +49,8 @@ static void timer_fired(unsigned long data) del_timer(&timer_two); } else if (data == 2) { printf("Should not be fired... bug in del_timer\n"); + } else if (data == 3) { + printf("Timer fired not registering again\n"); } else { printf("wtf... wrong data\n"); } @@ -55,6 +62,7 @@ int main(int argc, char** argv) schedule_timer(&timer_one, 3, 0); schedule_timer(&timer_two, 5, 0); + schedule_timer(&timer_three, 4, 0); while (1) { bsc_select_main(); |