aboutsummaryrefslogtreecommitdiff
path: root/deps/uv/test/test-tty.c
diff options
context:
space:
mode:
authorcjihrig <cjihrig@gmail.com>2018-10-08 13:14:58 -0400
committerRich Trott <rtrott@gmail.com>2018-10-09 06:55:34 -0700
commitc65a523597ccdf2b3544244679dae581040cf52f (patch)
treee14e34bb728360c271cd649ba7bd55ce5cef3ede /deps/uv/test/test-tty.c
parent13340d47fcdbc9fa0eaaeee52d2c09338590a797 (diff)
downloadandroid-node-v8-c65a523597ccdf2b3544244679dae581040cf52f.tar.gz
android-node-v8-c65a523597ccdf2b3544244679dae581040cf52f.tar.bz2
android-node-v8-c65a523597ccdf2b3544244679dae581040cf52f.zip
deps: upgrade to libuv 1.23.2
PR-URL: https://github.com/nodejs/node/pull/23336 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Fixes: https://github.com/nodejs/node/issues/23043 Fixes: https://github.com/nodejs/node/issues/21773 Fixes: https://github.com/nodejs/node/issues/16601 Fixes: https://github.com/nodejs/node/issues/22999 Fixes: https://github.com/nodejs/node/issues/23219 Fixes: https://github.com/nodejs/node/issues/23066 Fixes: https://github.com/nodejs/node/issues/23067 Fixes: https://github.com/nodejs/node/issues/23089
Diffstat (limited to 'deps/uv/test/test-tty.c')
-rw-r--r--deps/uv/test/test-tty.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/deps/uv/test/test-tty.c b/deps/uv/test/test-tty.c
index 3bbdfad780..979a6ec38d 100644
--- a/deps/uv/test/test-tty.c
+++ b/deps/uv/test/test-tty.c
@@ -310,6 +310,41 @@ TEST_IMPL(tty_large_write) {
MAKE_VALGRIND_HAPPY();
return 0;
}
+
+TEST_IMPL(tty_raw_cancel) {
+ int r;
+ int ttyin_fd;
+ uv_tty_t tty_in;
+ uv_loop_t* loop;
+ HANDLE handle;
+
+ loop = uv_default_loop();
+ /* Make sure we have an FD that refers to a tty */
+ handle = CreateFileA("conin$",
+ GENERIC_READ | GENERIC_WRITE,
+ FILE_SHARE_READ | FILE_SHARE_WRITE,
+ NULL,
+ OPEN_EXISTING,
+ FILE_ATTRIBUTE_NORMAL,
+ NULL);
+ ASSERT(handle != INVALID_HANDLE_VALUE);
+ ttyin_fd = _open_osfhandle((intptr_t) handle, 0);
+ ASSERT(ttyin_fd >= 0);
+ ASSERT(UV_TTY == uv_guess_handle(ttyin_fd));
+
+ r = uv_tty_init(uv_default_loop(), &tty_in, ttyin_fd, 1); /* Readable. */
+ ASSERT(r == 0);
+ r = uv_tty_set_mode(&tty_in, UV_TTY_MODE_RAW);
+ ASSERT(r == 0);
+ r = uv_read_start((uv_stream_t*)&tty_in, tty_raw_alloc, tty_raw_read);
+ ASSERT(r == 0);
+
+ r = uv_read_stop((uv_stream_t*) &tty_in);
+ ASSERT(r == 0);
+
+ MAKE_VALGRIND_HAPPY();
+ return 0;
+}
#endif