Merge libkqueue test suite through r119

Submitted by:	Mark Heily <mark@heily.com>
This commit is contained in:
rwatson 2009-12-15 10:43:20 +00:00
parent f88254b35a
commit 2bc44b9609
3 changed files with 18 additions and 15 deletions

View File

@ -1,5 +1,6 @@
/* AUTOMATICALLY GENERATED -- DO NOT EDIT */
/* $FreeBSD$ */
#define HAVE_ERR_H
#define HAVE_SYS_EVENT_H
#define HAVE_EV_DISPATCH 1
#define HAVE_EV_RECEIPT 1

View File

@ -235,7 +235,12 @@ main(int argc, char **argv)
int test_signal = 1;
int test_vnode = 1;
int test_timer = 1;
#ifdef __FreeBSD__
int test_user = 1;
#else
/* XXX-FIXME temporary */
int test_user = 0;
#endif
while (argc) {
if (strcmp(argv[0], "--no-proc") == 0)

View File

@ -45,12 +45,15 @@ event_wait(void)
test_begin(test_id);
test_no_kevents();
/* Add the event, and then trigger it */
kevent_add(kqfd, &kev, 1, EVFILT_USER, EV_ADD, 0, 0, NULL);
kevent_add(kqfd, &kev, 1, EVFILT_USER, EV_ADD | EV_CLEAR, 0, 0, NULL);
kevent_add(kqfd, &kev, 1, EVFILT_USER, 0, NOTE_TRIGGER, 0, NULL);
kev.fflags &= ~NOTE_FFCTRLMASK;
kev.fflags &= ~NOTE_TRIGGER;
kev.flags = EV_CLEAR;
kevent_cmp(&kev, kevent_get(kqfd));
test_no_kevents();
@ -66,6 +69,8 @@ disable_and_enable(void)
test_begin(test_id);
test_no_kevents();
kevent_add(kqfd, &kev, 1, EVFILT_USER, EV_ADD, 0, 0, NULL);
kevent_add(kqfd, &kev, 1, EVFILT_USER, EV_DISABLE, 0, 0, NULL);
@ -76,7 +81,7 @@ disable_and_enable(void)
kevent_add(kqfd, &kev, 1, EVFILT_USER, EV_ENABLE, 0, 0, NULL);
kevent_add(kqfd, &kev, 1, EVFILT_USER, 0, NOTE_TRIGGER, 0, NULL);
kev.flags = 0;
kev.flags = EV_CLEAR;
kev.fflags &= ~NOTE_FFCTRLMASK;
kev.fflags &= ~NOTE_TRIGGER;
kevent_cmp(&kev, kevent_get(kqfd));
@ -92,26 +97,18 @@ oneshot(void)
test_begin(test_id);
kevent_add(kqfd, &kev, 1, EVFILT_USER, EV_ADD | EV_ONESHOT, 0, 0, NULL);
test_no_kevents();
kevent_add(kqfd, &kev, 2, EVFILT_USER, EV_ADD | EV_ONESHOT, 0, 0, NULL);
puts(" -- event 1");
kevent_add(kqfd, &kev, 1, EVFILT_USER, 0, NOTE_TRIGGER, 0, NULL);
kevent_add(kqfd, &kev, 2, EVFILT_USER, 0, NOTE_TRIGGER, 0, NULL);
kev.flags = 0;
kev.flags = EV_ONESHOT;
kev.fflags &= ~NOTE_FFCTRLMASK;
kev.fflags &= ~NOTE_TRIGGER;
kevent_cmp(&kev, kevent_get(kqfd));
/* Try to trigger the event again. It is deleted, so that
should be an error. However, on FreeBSD 8 it is not an error,
so the event is ignored.
*/
puts(" -- triggering an event that will be ignored");
kev.flags = 0;
kev.fflags |= NOTE_TRIGGER;
if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0)
err(1, "%s", test_id);
test_no_kevents();
success();