Lines Matching refs:ATF_REQUIRE
65 ATF_REQUIRE(pthread_barrier_init(&ctx->barrier, NULL, 2) == 0);
129 ATF_REQUIRE((fd = timerfd_create(CLOCK_REALTIME, 0)) >= 0);
132 ATF_REQUIRE((fd = timerfd_create(CLOCK_MONOTONIC, 0)) >= 0);
159 ATF_REQUIRE((fd = kqueue()) >= 0); /* arbitrary fd type */
184 ATF_REQUIRE((fd = timerfd_create(CLOCK_MONOTONIC, 0)) >= 0);
191 ATF_REQUIRE(clock_gettime(CLOCK_MONOTONIC, &then) == 0);
192 ATF_REQUIRE(timerfd_settime(fd, 0, &its, NULL) == 0);
193 ATF_REQUIRE(timerfd_read(fd, &val) == 0);
194 ATF_REQUIRE(clock_gettime(CLOCK_MONOTONIC, &now) == 0);
195 ATF_REQUIRE(check_value_against_bounds(val, 1, 1));
220 ATF_REQUIRE((fd = timerfd_create(CLOCK_MONOTONIC,
228 ATF_REQUIRE(clock_gettime(CLOCK_MONOTONIC, &then) == 0);
229 ATF_REQUIRE(timerfd_settime(fd, 0, &its, NULL) == 0);
230 ATF_REQUIRE(sleep(1) == 0);
231 ATF_REQUIRE(clock_gettime(CLOCK_MONOTONIC, &now) == 0);
232 ATF_REQUIRE(timerfd_read(fd, &val) == 0);
234 ATF_REQUIRE(check_value_against_bounds(val, 3, 5));
259 ATF_REQUIRE((fd = timerfd_create(CLOCK_MONOTONIC, 0)) >= 0);
266 ATF_REQUIRE(clock_gettime(CLOCK_MONOTONIC, &then) == 0);
269 ATF_REQUIRE(timerfd_settime(fd, TFD_TIMER_ABSTIME, &its, NULL) == 0);
270 ATF_REQUIRE(timerfd_read(fd, &val) == 0);
271 ATF_REQUIRE(clock_gettime(CLOCK_MONOTONIC, &now) == 0);
272 ATF_REQUIRE(check_value_against_bounds(val, 1, 1));
298 ATF_REQUIRE((fd = timerfd_create(CLOCK_REALTIME, 0)) >= 0);
305 ATF_REQUIRE(clock_gettime(CLOCK_REALTIME, &now) == 0);
306 ATF_REQUIRE(timerfd_settime(fd, TFD_TIMER_CANCEL_ON_SET,
308 ATF_REQUIRE(clock_settime(CLOCK_REALTIME, &now) == 0);
322 ATF_REQUIRE(wait_barrier(ctx));
324 ATF_REQUIRE(sleep(2) == 0);
325 ATF_REQUIRE(clock_gettime(CLOCK_REALTIME, &now) == 0);
326 ATF_REQUIRE(clock_settime(CLOCK_REALTIME, &now) == 0);
345 ATF_REQUIRE((fd = timerfd_create(CLOCK_REALTIME, 0)) >= 0);
354 ATF_REQUIRE(timerfd_settime(fd, TFD_TIMER_CANCEL_ON_SET,
356 ATF_REQUIRE(pthread_create(&helper, NULL,
358 ATF_REQUIRE(wait_barrier(&ctx));
361 ATF_REQUIRE(pthread_join(helper, &join_val) == 0);
387 ATF_REQUIRE((fd = timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK)) >= 0);
389 ATF_REQUIRE((kq = kqueue()) >= 0);
391 ATF_REQUIRE(kevent(kq, kev, 1, NULL, 0, &ts) == 0);
402 ATF_REQUIRE(poll(fds, 1, 0) == 1);
403 ATF_REQUIRE(fds[0].revents == (POLLOUT | POLLWRNORM));
417 ATF_REQUIRE(select(fd + 1, &readfds, &writefds, &exceptfds, &tv) == 1);
418 ATF_REQUIRE(!FD_ISSET(fd, &readfds));
419 ATF_REQUIRE(FD_ISSET(fd, &writefds));
420 ATF_REQUIRE(!FD_ISSET(fd, &exceptfds));
429 ATF_REQUIRE(timerfd_settime(fd, 0, &its, NULL) == 0);
430 ATF_REQUIRE(sleep(2) == 0);
433 ATF_REQUIRE(fstat(fd, &st) == 0);
434 ATF_REQUIRE(st.st_size == 1);
440 ATF_REQUIRE(poll(fds, 1, 0) == 1);
441 ATF_REQUIRE(fds[0].revents == (POLLIN | POLLRDNORM |
452 ATF_REQUIRE(select(fd + 1, &readfds, &writefds, &exceptfds, &tv) == 2);
453 ATF_REQUIRE(FD_ISSET(fd, &readfds));
454 ATF_REQUIRE(FD_ISSET(fd, &writefds));
455 ATF_REQUIRE(!FD_ISSET(fd, &exceptfds));
461 ATF_REQUIRE(kevent(kq, NULL, 0, kev, 1, &ts) == 1);
462 ATF_REQUIRE(kev[0].ident == (uintptr_t)fd);
463 ATF_REQUIRE(kev[0].filter == EVFILT_READ);
464 ATF_REQUIRE((kev[0].flags & (EV_EOF | EV_ERROR)) == 0);
465 ATF_REQUIRE(kev[0].data == 1);
471 ATF_REQUIRE(timerfd_read(fd, &val) == 0);
472 ATF_REQUIRE(val == 1);
499 ATF_REQUIRE((fd = timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK)) >= 0);
501 ATF_REQUIRE((kq = kqueue()) >= 0);
503 ATF_REQUIRE(kevent(kq, kev, 1, NULL, 0, &ts) == 0);
525 ATF_REQUIRE(clock_gettime(CLOCK_MONOTONIC, &then) == 0);
526 ATF_REQUIRE(timerfd_settime(fd, 0, &its, NULL) == 0);
527 ATF_REQUIRE(poll(fds, 1, INFTIM) == 1);
528 ATF_REQUIRE(clock_gettime(CLOCK_MONOTONIC, &now) == 0);
529 ATF_REQUIRE(fds[0].revents == (POLLIN | POLLRDNORM));
530 ATF_REQUIRE(now.tv_sec - then.tv_sec >= 1);
536 ATF_REQUIRE(clock_gettime(CLOCK_MONOTONIC, &then) == 0);
537 ATF_REQUIRE(timerfd_settime(fd, 0, &its, NULL) == 0);
538 ATF_REQUIRE(select(fd + 1, &readfds, NULL, NULL, NULL) == 1);
539 ATF_REQUIRE(clock_gettime(CLOCK_MONOTONIC, &now) == 0);
540 ATF_REQUIRE(FD_ISSET(fd, &readfds));
541 ATF_REQUIRE(now.tv_sec - then.tv_sec >= 1);
545 ATF_REQUIRE(clock_gettime(CLOCK_MONOTONIC, &then) == 0);
546 ATF_REQUIRE(timerfd_settime(fd, 0, &its, NULL) == 0);
547 ATF_REQUIRE(kevent(kq, NULL, 0, kev, 1, NULL) == 1);
548 ATF_REQUIRE(clock_gettime(CLOCK_MONOTONIC, &now) == 0);
549 ATF_REQUIRE(kev[0].ident == (uintptr_t)fd);
550 ATF_REQUIRE(kev[0].filter == EVFILT_READ);
551 ATF_REQUIRE((kev[0].flags & (EV_EOF | EV_ERROR)) == 0);
552 ATF_REQUIRE(kev[0].data == 1);
565 ATF_REQUIRE(wait_barrier(ctx));
571 ATF_REQUIRE(sleep(5) == 0);
572 ATF_REQUIRE(close(ctx->fd) == 0);
593 ATF_REQUIRE((ctx.fd = timerfd_create(CLOCK_MONOTONIC, 0)) >= 0);
599 ATF_REQUIRE(timerfd_settime(ctx.fd, 0, &its, NULL) == 0);
602 ATF_REQUIRE(clock_gettime(CLOCK_MONOTONIC, &then) == 0);
603 ATF_REQUIRE(pthread_create(&helper, NULL,
611 ATF_REQUIRE(wait_barrier(&ctx));
613 ATF_REQUIRE(clock_gettime(CLOCK_MONOTONIC, &now) == 0);
616 ATF_REQUIRE(delta.tv_sec >= 5);
619 ATF_REQUIRE(pthread_join(helper, &join_val) == 0);
636 ATF_REQUIRE((tfd = timerfd_create(CLOCK_MONOTONIC, 0)) >= 0);
637 ATF_REQUIRE((fcntl(tfd, F_GETFL) & O_NONBLOCK) == 0);
638 ATF_REQUIRE(fcntl(tfd, F_SETFL, O_NONBLOCK) == 0);
639 ATF_REQUIRE((fcntl(tfd, F_GETFL) & O_NONBLOCK) != 0);
640 ATF_REQUIRE((fcntl(tfd, F_GETFD) & FD_CLOEXEC) == 0);
643 ATF_REQUIRE(ioctl(tfd, FIONREAD, &val) == 0);
644 ATF_REQUIRE(val == 0);
650 ATF_REQUIRE((tfd = timerfd_create(CLOCK_MONOTONIC,
652 ATF_REQUIRE((fcntl(tfd, F_GETFL) & ~O_ACCMODE) == O_NONBLOCK);
653 ATF_REQUIRE((fcntl(tfd, F_GETFD) & FD_CLOEXEC) != 0);
654 ATF_REQUIRE(fcntl(tfd, F_SETFD, 0) == 0);
655 ATF_REQUIRE((fcntl(tfd, F_GETFD) & FD_CLOEXEC) == 0);
656 ATF_REQUIRE(fcntl(tfd, F_SETFD, FD_CLOEXEC) == 0);
657 ATF_REQUIRE((fcntl(tfd, F_GETFD) & FD_CLOEXEC) != 0);