test: add epoll_ctl_mod() EEXIST and ENOENT tests to test-error

This commit is contained in:
Bert Belder 2017-12-07 22:30:54 +01:00
parent 937b9a27fa
commit 658775faee

View File

@ -115,6 +115,20 @@ int main(void) {
r = epoll_ctl(ep_type, -1, sock_hinv, &ev);
check_error(r < 0, EBADF, ERROR_INVALID_HANDLE);
/* Socket already in epoll set. */
r = epoll_ctl(ep_good, EPOLL_CTL_ADD, sock_good, &ev);
check(r == 0);
r = epoll_ctl(ep_good, EPOLL_CTL_ADD, sock_good, &ev);
check_error(r < 0, EEXIST, ERROR_ALREADY_EXISTS);
/* Socket not in epoll set. */
r = epoll_ctl(ep_good, EPOLL_CTL_DEL, sock_good, NULL);
check(r == 0);
r = epoll_ctl(ep_good, EPOLL_CTL_MOD, sock_good, &ev);
check_error(r < 0, ENOENT, ERROR_NOT_FOUND);
r = epoll_ctl(ep_good, EPOLL_CTL_DEL, sock_good, NULL);
check_error(r < 0, ENOENT, ERROR_NOT_FOUND);
r = closesocket(sock_good);
check(r == 0);
r = epoll_close(ep_good);