diff options
author | rwatson <rwatson@FreeBSD.org> | 2009-12-15 10:43:20 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2009-12-15 10:43:20 +0000 |
commit | 2bc44b96096e82af8f7720c1883039f28c130aa0 (patch) | |
tree | 048a646411c88c8e90711767594dbfa66ddfa799 /tools/regression/kqueue/user.c | |
parent | f88254b35a3ee2e8da5ac30ccb29b0b5bfa464be (diff) | |
download | FreeBSD-src-2bc44b96096e82af8f7720c1883039f28c130aa0.zip FreeBSD-src-2bc44b96096e82af8f7720c1883039f28c130aa0.tar.gz |
Merge libkqueue test suite through r119
Submitted by: Mark Heily <mark@heily.com>
Diffstat (limited to 'tools/regression/kqueue/user.c')
-rw-r--r-- | tools/regression/kqueue/user.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/tools/regression/kqueue/user.c b/tools/regression/kqueue/user.c index 800ee43..9ba25f9 100644 --- a/tools/regression/kqueue/user.c +++ b/tools/regression/kqueue/user.c @@ -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(); |