From 66b64819d5e7cf31e2faaef655af754d809f6d72 Mon Sep 17 00:00:00 2001 From: eradman Date: Tue, 4 Jun 2013 14:14:36 +0000 Subject: [PATCH] Adapt test_kevent_user_multi_trigger_merged() from the 1.0 branch. It appears that 2.0-current does not suffer from the same problem. Tests pass on Debian 6.0/i386. git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@649 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7 --- TODO | 1 - test/user.c | 23 +++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/TODO b/TODO index 527f873..6ebb725 100644 --- a/TODO +++ b/TODO @@ -17,4 +17,3 @@ * Check other filters for the EV_DISPATCH bug that was fixed in r252. - * Merge the fix from r546 in the stable branch. diff --git a/test/user.c b/test/user.c index 8724a1d..54a526f 100644 --- a/test/user.c +++ b/test/user.c @@ -113,6 +113,28 @@ test_kevent_user_oneshot(struct test_context *ctx) test_no_kevents(ctx->kqfd); } +static void +test_kevent_user_multi_trigger_merged(struct test_context *ctx) +{ + struct kevent kev, ret; + int i; + + test_no_kevents(ctx->kqfd); + + kevent_add(ctx->kqfd, &kev, 2, EVFILT_USER, EV_ADD | EV_CLEAR, 0, 0, NULL); + + for (i = 0; i < 10; i++) + kevent_add(ctx->kqfd, &kev, 2, EVFILT_USER, 0, NOTE_TRIGGER, 0, NULL); + + kev.flags = EV_CLEAR; + kev.fflags &= ~NOTE_FFCTRLMASK; + kev.fflags &= ~NOTE_TRIGGER; + kevent_get(&ret, ctx->kqfd); + kevent_cmp(&kev, &ret); + + test_no_kevents(ctx->kqfd); +} + #ifdef EV_DISPATCH void test_kevent_user_dispatch(struct test_context *ctx) @@ -163,6 +185,7 @@ test_evfilt_user(struct test_context *ctx) test(kevent_user_get_hires, ctx); test(kevent_user_disable_and_enable, ctx); test(kevent_user_oneshot, ctx); + test(kevent_user_multi_trigger_merged, ctx); #ifdef EV_DISPATCH test(kevent_user_dispatch, ctx); #endif