test: Test EBADF tty handling

PR-URL: https://github.com/libuv/libuv/pull/2753
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
This commit is contained in:
Kevin Adler 2020-03-25 10:41:28 -05:00 committed by Richard Lau
parent 5f1ac8ee36
commit 4878e8284f
No known key found for this signature in database
GPG Key ID: C43CEC45C17AB93C

View File

@ -360,6 +360,8 @@ TEST_IMPL(tty_file) {
if (fd != -1) {
ASSERT(UV_EINVAL == uv_tty_init(&loop, &tty, fd, 1));
ASSERT(0 == close(fd));
/* test EBADF handling */
ASSERT(UV_EINVAL == uv_tty_init(&loop, &tty, fd, 1));
}
/* Bug on AIX where '/dev/random' returns 1 from isatty() */