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
This commit is contained in:
eradman 2013-06-04 14:14:36 +00:00
parent 667dfef7a7
commit 66b64819d5
2 changed files with 23 additions and 1 deletions

1
TODO
View File

@ -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.

View File

@ -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