diff --git a/tests/active.c b/tests/active.c index 63c9033..f464f34 100644 --- a/tests/active.c +++ b/tests/active.c @@ -52,3 +52,10 @@ int main(void) return uev_run(&ctx, 0); } + +/** + * Local Variables: + * indent-tabs-mode: t + * c-file-style: "linux" + * End: + */ diff --git a/tests/cronrun.c b/tests/cronrun.c index 668fbef..855efd3 100644 --- a/tests/cronrun.c +++ b/tests/cronrun.c @@ -28,6 +28,7 @@ #define TIMEOUT 2 #define INTERVAL 2 +int result = -1; struct timeval tv; static void cron_job(uev_t *w, void *UNUSED(arg), int events) @@ -45,12 +46,15 @@ static void cron_job(uev_t *w, void *UNUSED(arg), int events) printf("Cron job HELO %s", ctime(&now.tv_sec)); fail_unless(now.tv_sec == tv.tv_sec); - if (!laps--) + if (!laps--) { + result = 0; uev_exit(w->ctx); + } } int main(void) { + int rc; uev_t cron_watcher; uev_ctx_t ctx; time_t when, interval; @@ -66,7 +70,10 @@ int main(void) interval = INTERVAL; uev_cron_init(&ctx, &cron_watcher, cron_job, NULL, when, interval); - return uev_run(&ctx, 0); + rc = uev_run(&ctx, 0); + fail_unless(result == 0); + + return rc; } /** diff --git a/tests/timer.c b/tests/timer.c index 79d06cc..b287ea8 100644 --- a/tests/timer.c +++ b/tests/timer.c @@ -3,6 +3,8 @@ #include #define TIMEOUT 2 /* 2 sec */ + +int result = -1; struct timeval start; static void cb(uev_t *w, void *UNUSED(arg), int events) @@ -15,11 +17,13 @@ static void cb(uev_t *w, void *UNUSED(arg), int events) gettimeofday(&now, NULL); fail_unless(now.tv_sec == start.tv_sec + TIMEOUT); + result = 0; uev_exit(w->ctx); } int main(void) { + int rc; uev_t w; uev_ctx_t ctx; @@ -27,5 +31,15 @@ int main(void) uev_timer_init(&ctx, &w, cb, NULL, TIMEOUT * 1000, 0); gettimeofday(&start, NULL); - return uev_run(&ctx, 0); + rc = uev_run(&ctx, 0); + fail_unless(result == 0); + + return rc; } + +/** + * Local Variables: + * indent-tabs-mode: t + * c-file-style: "linux" + * End: + */