test: add another (failing) epoll_ctl() error precedence test

This commit is contained in:
Bert Belder 2020-11-01 18:34:44 +01:00
parent f222c5eab1
commit 4dfe24747e
No known key found for this signature in database
GPG Key ID: 7A77887B2E2ED461

View File

@ -115,6 +115,19 @@ int main(void) {
r = epoll_ctl(ep_type, -1, sock_hinv, &ev); r = epoll_ctl(ep_type, -1, sock_hinv, &ev);
check_error(r < 0, EBADF, ERROR_INVALID_HANDLE); check_error(r < 0, EBADF, ERROR_INVALID_HANDLE);
/* Precedence: `ENOTSOCK` before `EINVAL`.
* If both `ephnd` and `sock` are valid handles, the next step is to verify
* that `sock` is actually a socket. Any further checks of `ephnd` and
* `op` are done later.
*
* TODO: this test currently doesn't pass; fix it.
*
* r = epoll_ctl(ep_type, EPOLL_CTL_ADD, sock_type, &ev);
* check_error(r < 0, ENOTSOCK, WSAENOTSOCK);
* r = epoll_ctl(ep_good, 4, sock_type, &ev);
* check_error(r < 0, ENOTSOCK, WSAENOTSOCK);
*/
/* Socket already in epoll set. */ /* Socket already in epoll set. */
r = epoll_ctl(ep_good, EPOLL_CTL_ADD, sock_good, &ev); r = epoll_ctl(ep_good, EPOLL_CTL_ADD, sock_good, &ev);
check(r == 0); check(r == 0);