mirror of
https://github.com/troglobit/libuev.git
synced 2026-11-23 20:21:58 +00:00
tests: Add basic error handling to callbacks, for reference
Many users look at both examples *and* unit tests to learn how to use a library. We should pride ourselves in that we have not just working but also correct and readable tests. Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
9df7cbfc52
commit
505a7214a8
4 files changed
+29
-6
No files matched your search
+4
-1
@@ -12,8 +12,11 @@ uev_t timer3;
|
||||
uev_t cron1;
|
||||
uev_t cron2;
|
||||
|
||||
static void cb(uev_t *w, void *UNUSED(arg), int UNUSED(events))
|
||||
static void cb(uev_t *w, void *UNUSED(arg), int events)
|
||||
{
|
||||
if (UEV_ERROR == events)
|
||||
fprintf(stderr, "timer watcher failed, ignoring ...\n");
|
||||
|
||||
fail_unless(w == &timer1);
|
||||
|
||||
fail_unless(uev_timer_active(&timer2));
|
||||
|
||||
Reference in new issue
Block a user