mirror of
https://github.com/troglobit/libuev.git
synced 2026-10-18 10:39:31 +00:00
Relocate tests/ -> test/
For my own sanity, test/ is used in every other project of mine. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
d7a8c7895b
commit
caa62910db
12 files changed
+6
-6
No files matched your search
+34
@@ -0,0 +1,34 @@
|
||||
#include "check.h"
|
||||
|
||||
uev_t timer, file;
|
||||
int counter = 10;
|
||||
|
||||
static void cb(uev_t *w, void *arg, int events)
|
||||
{
|
||||
if (UEV_ERROR == events)
|
||||
fprintf(stderr, "timer watcher failed, ignoring ...\n");
|
||||
|
||||
if (counter--)
|
||||
return;
|
||||
|
||||
uev_exit(w->ctx);
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
uev_ctx_t ctx;
|
||||
FILE *fp;
|
||||
|
||||
uev_init(&ctx);
|
||||
uev_timer_init(&ctx, &timer, cb, NULL, 100, 100);
|
||||
|
||||
fp = fopen("/dev/one", "r");
|
||||
if (fp)
|
||||
uev_io_init(&ctx, &file, cb, NULL, fileno(fp), UEV_READ);
|
||||
|
||||
uev_run(&ctx, 0);
|
||||
|
||||
uev_exit(&ctx); /* Should not hang event loop, troglobit/uftpd#16 */
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in new issue
Block a user