summaryrefslogtreecommitdiff
path: root/deps/uv/test
diff options
context:
space:
mode:
Diffstat (limited to 'deps/uv/test')
-rw-r--r--deps/uv/test/echo-server.c4
-rw-r--r--deps/uv/test/run-tests.c15
-rw-r--r--deps/uv/test/runner-unix.c107
-rw-r--r--deps/uv/test/runner-win.c5
-rw-r--r--deps/uv/test/runner.c3
-rw-r--r--deps/uv/test/task.h6
-rw-r--r--deps/uv/test/test-fs.c54
-rw-r--r--deps/uv/test/test-idna.c195
-rw-r--r--deps/uv/test/test-ipc-heavy-traffic-deadlock-bug.c1
-rw-r--r--deps/uv/test/test-ipc-send-recv.c1
-rw-r--r--deps/uv/test/test-ipc.c1
-rw-r--r--deps/uv/test/test-list.h12
-rw-r--r--deps/uv/test/test-process-title-threadsafe.c6
-rw-r--r--deps/uv/test/test-spawn.c1
-rw-r--r--deps/uv/test/test-stdio-over-pipes.c1
-rw-r--r--deps/uv/test/test.gyp1
16 files changed, 384 insertions, 29 deletions
diff --git a/deps/uv/test/echo-server.c b/deps/uv/test/echo-server.c
index bfed67675d..a38e975d48 100644
--- a/deps/uv/test/echo-server.c
+++ b/deps/uv/test/echo-server.c
@@ -340,6 +340,7 @@ HELPER_IMPL(tcp4_echo_server) {
if (tcp4_echo_start(TEST_PORT))
return 1;
+ notify_parent_process();
uv_run(loop, UV_RUN_DEFAULT);
return 0;
}
@@ -351,6 +352,7 @@ HELPER_IMPL(tcp6_echo_server) {
if (tcp6_echo_start(TEST_PORT))
return 1;
+ notify_parent_process();
uv_run(loop, UV_RUN_DEFAULT);
return 0;
}
@@ -362,6 +364,7 @@ HELPER_IMPL(pipe_echo_server) {
if (pipe_echo_start(TEST_PIPENAME))
return 1;
+ notify_parent_process();
uv_run(loop, UV_RUN_DEFAULT);
return 0;
}
@@ -373,6 +376,7 @@ HELPER_IMPL(udp4_echo_server) {
if (udp4_echo_start(TEST_PORT))
return 1;
+ notify_parent_process();
uv_run(loop, UV_RUN_DEFAULT);
return 0;
}
diff --git a/deps/uv/test/run-tests.c b/deps/uv/test/run-tests.c
index 9b8af04608..42bde0bb96 100644
--- a/deps/uv/test/run-tests.c
+++ b/deps/uv/test/run-tests.c
@@ -109,20 +109,24 @@ static int maybe_run_test(int argc, char **argv) {
}
if (strcmp(argv[1], "spawn_helper1") == 0) {
+ notify_parent_process();
return 1;
}
if (strcmp(argv[1], "spawn_helper2") == 0) {
+ notify_parent_process();
printf("hello world\n");
return 1;
}
if (strcmp(argv[1], "spawn_tcp_server_helper") == 0) {
+ notify_parent_process();
return spawn_tcp_server_helper();
}
if (strcmp(argv[1], "spawn_helper3") == 0) {
char buffer[256];
+ notify_parent_process();
ASSERT(buffer == fgets(buffer, sizeof(buffer) - 1, stdin));
buffer[sizeof(buffer) - 1] = '\0';
fputs(buffer, stdout);
@@ -130,12 +134,14 @@ static int maybe_run_test(int argc, char **argv) {
}
if (strcmp(argv[1], "spawn_helper4") == 0) {
+ notify_parent_process();
/* Never surrender, never return! */
while (1) uv_sleep(10000);
}
if (strcmp(argv[1], "spawn_helper5") == 0) {
const char out[] = "fourth stdio!\n";
+ notify_parent_process();
#ifdef _WIN32
DWORD bytes;
WriteFile((HANDLE) _get_osfhandle(3), out, sizeof(out) - 1, &bytes, NULL);
@@ -156,6 +162,8 @@ static int maybe_run_test(int argc, char **argv) {
if (strcmp(argv[1], "spawn_helper6") == 0) {
int r;
+ notify_parent_process();
+
r = fprintf(stdout, "hello world\n");
ASSERT(r > 0);
@@ -168,6 +176,9 @@ static int maybe_run_test(int argc, char **argv) {
if (strcmp(argv[1], "spawn_helper7") == 0) {
int r;
char *test;
+
+ notify_parent_process();
+
/* Test if the test value from the parent is still set */
test = getenv("ENV_TEST");
ASSERT(test != NULL);
@@ -181,6 +192,8 @@ static int maybe_run_test(int argc, char **argv) {
#ifndef _WIN32
if (strcmp(argv[1], "spawn_helper8") == 0) {
int fd;
+
+ notify_parent_process();
ASSERT(sizeof(fd) == read(0, &fd, sizeof(fd)));
ASSERT(fd > 2);
ASSERT(-1 == write(fd, "x", 1));
@@ -190,6 +203,7 @@ static int maybe_run_test(int argc, char **argv) {
#endif /* !_WIN32 */
if (strcmp(argv[1], "spawn_helper9") == 0) {
+ notify_parent_process();
return spawn_stdin_stdout();
}
@@ -200,6 +214,7 @@ static int maybe_run_test(int argc, char **argv) {
ASSERT(uid == getuid());
ASSERT(gid == getgid());
+ notify_parent_process();
return 1;
}
diff --git a/deps/uv/test/runner-unix.c b/deps/uv/test/runner-unix.c
index de0db0cc48..432cf33d48 100644
--- a/deps/uv/test/runner-unix.c
+++ b/deps/uv/test/runner-unix.c
@@ -40,6 +40,31 @@
#include <sys/time.h>
#include <pthread.h>
+extern char** environ;
+
+static void closefd(int fd) {
+ if (close(fd) == 0 || errno == EINTR || errno == EINPROGRESS)
+ return;
+
+ perror("close");
+ abort();
+}
+
+
+void notify_parent_process(void) {
+ char* arg;
+ int fd;
+
+ arg = getenv("UV_TEST_RUNNER_FD");
+ if (arg == NULL)
+ return;
+
+ fd = atoi(arg);
+ assert(fd > STDERR_FILENO);
+ unsetenv("UV_TEST_RUNNER_FD");
+ closefd(fd);
+}
+
/* Do platform-specific initialization. */
int platform_init(int argc, char **argv) {
@@ -64,9 +89,31 @@ int process_start(char* name, char* part, process_info_t* p, int is_helper) {
int stdout_fd;
const char* arg;
char* args[16];
+ int pipefd[2];
+ char fdstr[8];
+ ssize_t rc;
int n;
pid_t pid;
+ arg = getenv("UV_USE_VALGRIND");
+ n = 0;
+
+ /* Disable valgrind for helpers, it complains about helpers leaking memory.
+ * They're killed after the test and as such never get a chance to clean up.
+ */
+ if (is_helper == 0 && arg != NULL && atoi(arg) != 0) {
+ args[n++] = "valgrind";
+ args[n++] = "--quiet";
+ args[n++] = "--leak-check=full";
+ args[n++] = "--show-reachable=yes";
+ args[n++] = "--error-exitcode=125";
+ }
+
+ args[n++] = executable_path;
+ args[n++] = name;
+ args[n++] = part;
+ args[n++] = NULL;
+
stdout_file = tmpfile();
stdout_fd = fileno(stdout_file);
if (!stdout_file) {
@@ -74,6 +121,19 @@ int process_start(char* name, char* part, process_info_t* p, int is_helper) {
return -1;
}
+ if (is_helper) {
+ if (pipe(pipefd)) {
+ perror("pipe");
+ return -1;
+ }
+
+ snprintf(fdstr, sizeof(fdstr), "%d", pipefd[1]);
+ if (setenv("UV_TEST_RUNNER_FD", fdstr, /* overwrite */ 1)) {
+ perror("setenv");
+ return -1;
+ }
+ }
+
p->terminated = 0;
p->status = 0;
@@ -86,29 +146,12 @@ int process_start(char* name, char* part, process_info_t* p, int is_helper) {
if (pid == 0) {
/* child */
- arg = getenv("UV_USE_VALGRIND");
- n = 0;
-
- /* Disable valgrind for helpers, it complains about helpers leaking memory.
- * They're killed after the test and as such never get a chance to clean up.
- */
- if (is_helper == 0 && arg != NULL && atoi(arg) != 0) {
- args[n++] = "valgrind";
- args[n++] = "--quiet";
- args[n++] = "--leak-check=full";
- args[n++] = "--show-reachable=yes";
- args[n++] = "--error-exitcode=125";
- }
-
- args[n++] = executable_path;
- args[n++] = name;
- args[n++] = part;
- args[n++] = NULL;
-
+ if (is_helper)
+ closefd(pipefd[0]);
dup2(stdout_fd, STDOUT_FILENO);
dup2(stdout_fd, STDERR_FILENO);
- execvp(args[0], args);
- perror("execvp()");
+ execve(args[0], args, environ);
+ perror("execve()");
_exit(127);
}
@@ -117,6 +160,28 @@ int process_start(char* name, char* part, process_info_t* p, int is_helper) {
p->name = strdup(name);
p->stdout_file = stdout_file;
+ if (!is_helper)
+ return 0;
+
+ closefd(pipefd[1]);
+ unsetenv("UV_TEST_RUNNER_FD");
+
+ do
+ rc = read(pipefd[0], &n, 1);
+ while (rc == -1 && errno == EINTR);
+
+ closefd(pipefd[0]);
+
+ if (rc == -1) {
+ perror("read");
+ return -1;
+ }
+
+ if (rc > 0) {
+ fprintf(stderr, "EOF expected but got data.\n");
+ return -1;
+ }
+
return 0;
}
diff --git a/deps/uv/test/runner-win.c b/deps/uv/test/runner-win.c
index aa52d7cc5a..e3e91a7b69 100644
--- a/deps/uv/test/runner-win.c
+++ b/deps/uv/test/runner-win.c
@@ -76,6 +76,11 @@ int process_start(char *name, char *part, process_info_t *p, int is_helper) {
PROCESS_INFORMATION pi;
DWORD result;
+ if (!is_helper) {
+ /* Give the helpers time to settle. Race-y, fix this. */
+ uv_sleep(250);
+ }
+
if (GetTempPathW(sizeof(path) / sizeof(WCHAR), (WCHAR*)&path) == 0)
goto error;
if (GetTempFileNameW((WCHAR*)&path, L"uv", 0, (WCHAR*)&filename) == 0)
diff --git a/deps/uv/test/runner.c b/deps/uv/test/runner.c
index f017902a04..aec560a59d 100644
--- a/deps/uv/test/runner.c
+++ b/deps/uv/test/runner.c
@@ -215,9 +215,6 @@ int run_test(const char* test,
process_count++;
}
- /* Give the helpers time to settle. Race-y, fix this. */
- uv_sleep(250);
-
/* Now start the test itself. */
for (task = TASKS; task->main; task++) {
if (strcmp(test, task->task_name) != 0) {
diff --git a/deps/uv/test/task.h b/deps/uv/test/task.h
index 92a90a540b..282c02d50c 100644
--- a/deps/uv/test/task.h
+++ b/deps/uv/test/task.h
@@ -181,6 +181,12 @@ extern int snprintf(char*, size_t, const char*, ...);
# define UNUSED
#endif
+#if defined(_WIN32)
+#define notify_parent_process() ((void) 0)
+#else
+extern void notify_parent_process(void);
+#endif
+
/* Fully close a loop */
static void close_walk_cb(uv_handle_t* handle, void* arg) {
if (!uv_is_closing(handle))
diff --git a/deps/uv/test/test-fs.c b/deps/uv/test/test-fs.c
index 01f5a7b023..038d2dd615 100644
--- a/deps/uv/test/test-fs.c
+++ b/deps/uv/test/test-fs.c
@@ -3037,6 +3037,60 @@ TEST_IMPL(fs_write_alotof_bufs_with_offset) {
return 0;
}
+TEST_IMPL(fs_read_dir) {
+ int r;
+ char buf[2];
+ loop = uv_default_loop();
+
+ /* Setup */
+ rmdir("test_dir");
+ r = uv_fs_mkdir(loop, &mkdir_req, "test_dir", 0755, mkdir_cb);
+ ASSERT(r == 0);
+ uv_run(loop, UV_RUN_DEFAULT);
+ ASSERT(mkdir_cb_count == 1);
+ /* Setup Done Here */
+
+ /* Get a file descriptor for the directory */
+ r = uv_fs_open(loop,
+ &open_req1,
+ "test_dir",
+ UV_FS_O_RDONLY | UV_FS_O_DIRECTORY,
+ S_IWUSR | S_IRUSR,
+ NULL);
+ ASSERT(r >= 0);
+ uv_fs_req_cleanup(&open_req1);
+
+ /* Try to read data from the directory */
+ iov = uv_buf_init(buf, sizeof(buf));
+ r = uv_fs_read(NULL, &read_req, open_req1.result, &iov, 1, 0, NULL);
+#if defined(__FreeBSD__) || \
+ defined(__OpenBSD__) || \
+ defined(__NetBSD__) || \
+ defined(__DragonFly__) || \
+ defined(_AIX) || \
+ defined(__sun) || \
+ defined(__MVS__)
+ /*
+ * As of now, these operating systems support reading from a directory,
+ * that too depends on the filesystem this temporary test directory is
+ * created on. That is why this assertion is a bit lenient.
+ */
+ ASSERT((r >= 0) || (r == UV_EISDIR));
+#else
+ ASSERT(r == UV_EISDIR);
+#endif
+ uv_fs_req_cleanup(&read_req);
+
+ r = uv_fs_close(NULL, &close_req, open_req1.result, NULL);
+ ASSERT(r == 0);
+ uv_fs_req_cleanup(&close_req);
+
+ /* Cleanup */
+ rmdir("test_dir");
+
+ MAKE_VALGRIND_HAPPY();
+ return 0;
+}
#ifdef _WIN32
diff --git a/deps/uv/test/test-idna.c b/deps/uv/test/test-idna.c
new file mode 100644
index 0000000000..b76853cb99
--- /dev/null
+++ b/deps/uv/test/test-idna.c
@@ -0,0 +1,195 @@
+/* Copyright The libuv project and contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include "task.h"
+#include "../src/idna.c"
+#include <string.h>
+
+TEST_IMPL(utf8_decode1) {
+ const char* p;
+ char b[32];
+ int i;
+
+ /* ASCII. */
+ p = b;
+ snprintf(b, sizeof(b), "%c\x7F", 0x00);
+ ASSERT(0 == uv__utf8_decode1(&p, b + sizeof(b)));
+ ASSERT(p == b + 1);
+ ASSERT(127 == uv__utf8_decode1(&p, b + sizeof(b)));
+ ASSERT(p == b + 2);
+
+ /* Two-byte sequences. */
+ p = b;
+ snprintf(b, sizeof(b), "\xC2\x80\xDF\xBF");
+ ASSERT(128 == uv__utf8_decode1(&p, b + sizeof(b)));
+ ASSERT(p == b + 2);
+ ASSERT(0x7FF == uv__utf8_decode1(&p, b + sizeof(b)));
+ ASSERT(p == b + 4);
+
+ /* Three-byte sequences. */
+ p = b;
+ snprintf(b, sizeof(b), "\xE0\xA0\x80\xEF\xBF\xBF");
+ ASSERT(0x800 == uv__utf8_decode1(&p, b + sizeof(b)));
+ ASSERT(p == b + 3);
+ ASSERT(0xFFFF == uv__utf8_decode1(&p, b + sizeof(b)));
+ ASSERT(p == b + 6);
+
+ /* Four-byte sequences. */
+ p = b;
+ snprintf(b, sizeof(b), "\xF0\x90\x80\x80\xF4\x8F\xBF\xBF");
+ ASSERT(0x10000 == uv__utf8_decode1(&p, b + sizeof(b)));
+ ASSERT(p == b + 4);
+ ASSERT(0x10FFFF == uv__utf8_decode1(&p, b + sizeof(b)));
+ ASSERT(p == b + 8);
+
+ /* Four-byte sequences > U+10FFFF; disallowed. */
+ p = b;
+ snprintf(b, sizeof(b), "\xF4\x90\xC0\xC0\xF7\xBF\xBF\xBF");
+ ASSERT((unsigned) -1 == uv__utf8_decode1(&p, b + sizeof(b)));
+ ASSERT(p == b + 4);
+ ASSERT((unsigned) -1 == uv__utf8_decode1(&p, b + sizeof(b)));
+ ASSERT(p == b + 8);
+
+ /* Overlong; disallowed. */
+ p = b;
+ snprintf(b, sizeof(b), "\xC0\x80\xC1\x80");
+ ASSERT((unsigned) -1 == uv__utf8_decode1(&p, b + sizeof(b)));
+ ASSERT(p == b + 2);
+ ASSERT((unsigned) -1 == uv__utf8_decode1(&p, b + sizeof(b)));
+ ASSERT(p == b + 4);
+
+ /* Surrogate pairs; disallowed. */
+ p = b;
+ snprintf(b, sizeof(b), "\xED\xA0\x80\xED\xA3\xBF");
+ ASSERT((unsigned) -1 == uv__utf8_decode1(&p, b + sizeof(b)));
+ ASSERT(p == b + 3);
+ ASSERT((unsigned) -1 == uv__utf8_decode1(&p, b + sizeof(b)));
+ ASSERT(p == b + 6);
+
+ /* Simply illegal. */
+ p = b;
+ snprintf(b, sizeof(b), "\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF");
+
+ for (i = 1; i <= 8; i++) {
+ ASSERT((unsigned) -1 == uv__utf8_decode1(&p, b + sizeof(b)));
+ ASSERT(p == b + i);
+ }
+
+ return 0;
+}
+
+/* Doesn't work on z/OS because that platform uses EBCDIC, not ASCII. */
+#ifndef __MVS__
+
+#define F(input, err) \
+ do { \
+ char d[256] = {0}; \
+ static const char s[] = "" input ""; \
+ ASSERT(err == uv__idna_toascii(s, s + sizeof(s) - 1, d, d + sizeof(d))); \
+ } while (0)
+
+#define T(input, expected) \
+ do { \
+ long n; \
+ char d1[256] = {0}; \
+ char d2[256] = {0}; \
+ static const char s[] = "" input ""; \
+ n = uv__idna_toascii(s, s + sizeof(s) - 1, d1, d1 + sizeof(d1)); \
+ ASSERT(n == sizeof(expected)); \
+ ASSERT(0 == memcmp(d1, expected, n)); \
+ /* Sanity check: encoding twice should not change the output. */ \
+ n = uv__idna_toascii(d1, d1 + strlen(d1), d2, d2 + sizeof(d2)); \
+ ASSERT(n == sizeof(expected)); \
+ ASSERT(0 == memcmp(d2, expected, n)); \
+ ASSERT(0 == memcmp(d1, d2, sizeof(d2))); \
+ } while (0)
+
+TEST_IMPL(idna_toascii) {
+ /* Illegal inputs. */
+ F("\xC0\x80\xC1\x80", UV_EINVAL); /* Overlong UTF-8 sequence. */
+ F("\xC0\x80\xC1\x80.com", UV_EINVAL); /* Overlong UTF-8 sequence. */
+ /* No conversion. */
+ T("", "");
+ T(".", ".");
+ T(".com", ".com");
+ T("example", "example");
+ T("example-", "example-");
+ T("straße.de", "xn--strae-oqa.de");
+ /* Test cases adapted from punycode.js. Most are from RFC 3492. */
+ T("foo.bar", "foo.bar");
+ T("mañana.com", "xn--maana-pta.com");
+ T("example.com.", "example.com.");
+ T("bücher.com", "xn--bcher-kva.com");
+ T("café.com", "xn--caf-dma.com");
+ T("café.café.com", "xn--caf-dma.xn--caf-dma.com");
+ T("☃-⌘.com", "xn----dqo34k.com");
+ T("퐀☃-⌘.com", "xn----dqo34kn65z.com");
+ T("💩.la", "xn--ls8h.la");
+ T("mañana.com", "xn--maana-pta.com");
+ T("mañana。com", "xn--maana-pta.com");
+ T("mañana.com", "xn--maana-pta.com");
+ T("mañana。com", "xn--maana-pta.com");
+ T("ü", "xn--tda");
+ T(".ü", ".xn--tda");
+ T("ü.ü", "xn--tda.xn--tda");
+ T("ü.ü.", "xn--tda.xn--tda.");
+ T("üëäö♥", "xn--4can8av2009b");
+ T("Willst du die Blüthe des frühen, die Früchte des späteren Jahres",
+ "xn--Willst du die Blthe des frhen, "
+ "die Frchte des spteren Jahres-x9e96lkal");
+ T("ليهمابتكلموشعربي؟", "xn--egbpdaj6bu4bxfgehfvwxn");
+ T("他们为什么不说中文", "xn--ihqwcrb4cv8a8dqg056pqjye");
+ T("他們爲什麽不說中文", "xn--ihqwctvzc91f659drss3x8bo0yb");
+ T("Pročprostěnemluvíčesky", "xn--Proprostnemluvesky-uyb24dma41a");
+ T("למההםפשוטלאמדבריםעברית", "xn--4dbcagdahymbxekheh6e0a7fei0b");
+ T("यहलोगहिन्दीक्योंनहींबोलसकतेहैं",
+ "xn--i1baa7eci9glrd9b2ae1bj0hfcgg6iyaf8o0a1dig0cd");
+ T("なぜみんな日本語を話してくれないのか",
+ "xn--n8jok5ay5dzabd5bym9f0cm5685rrjetr6pdxa");
+ T("세계의모든사람들이한국어를이해한다면얼마나좋을까",
+ "xn--989aomsvi5e83db1d2a355cv1e0vak1d"
+ "wrv93d5xbh15a0dt30a5jpsd879ccm6fea98c");
+ T("почемужеонинеговорятпорусски", "xn--b1abfaaepdrnnbgefbadotcwatmq2g4l");
+ T("PorquénopuedensimplementehablarenEspañol",
+ "xn--PorqunopuedensimplementehablarenEspaol-fmd56a");
+ T("TạisaohọkhôngthểchỉnóitiếngViệt",
+ "xn--TisaohkhngthchnitingVit-kjcr8268qyxafd2f1b9g");
+ T("3年B組金八先生", "xn--3B-ww4c5e180e575a65lsy2b");
+ T("安室奈美恵-with-SUPER-MONKEYS",
+ "xn---with-SUPER-MONKEYS-pc58ag80a8qai00g7n9n");
+ T("Hello-Another-Way-それぞれの場所",
+ "xn--Hello-Another-Way--fc4qua05auwb3674vfr0b");
+ T("ひとつ屋根の下2", "xn--2-u9tlzr9756bt3uc0v");
+ T("MajiでKoiする5秒前", "xn--MajiKoi5-783gue6qz075azm5e");
+ T("パフィーdeルンバ", "xn--de-jg4avhby1noc0d");
+ T("そのスピードで", "xn--d9juau41awczczp");
+ T("-> $1.00 <-", "-> $1.00 <-");
+ /* Test cases from https://unicode.org/reports/tr46/ */
+ T("faß.de", "xn--fa-hia.de");
+ T("βόλος.com", "xn--nxasmm1c.com");
+ T("ශ්‍රී.com", "xn--10cl1a0b660p.com");
+ T("نامه‌ای.com", "xn--mgba3gch31f060k.com");
+ return 0;
+}
+
+#undef T
+
+#endif /* __MVS__ */
diff --git a/deps/uv/test/test-ipc-heavy-traffic-deadlock-bug.c b/deps/uv/test/test-ipc-heavy-traffic-deadlock-bug.c
index 240fc64588..325305a644 100644
--- a/deps/uv/test/test-ipc-heavy-traffic-deadlock-bug.c
+++ b/deps/uv/test/test-ipc-heavy-traffic-deadlock-bug.c
@@ -150,6 +150,7 @@ int ipc_helper_heavy_traffic_deadlock_bug(void) {
r = uv_pipe_open(&pipe, 0);
ASSERT(r == 0);
+ notify_parent_process();
do_writes_and_reads((uv_stream_t*) &pipe);
uv_sleep(100);
diff --git a/deps/uv/test/test-ipc-send-recv.c b/deps/uv/test/test-ipc-send-recv.c
index 3dedc86b8b..166225c01c 100644
--- a/deps/uv/test/test-ipc-send-recv.c
+++ b/deps/uv/test/test-ipc-send-recv.c
@@ -397,6 +397,7 @@ int run_ipc_send_recv_helper(uv_loop_t* loop, int inprocess) {
send_recv_start();
}
+ notify_parent_process();
r = uv_run(loop, UV_RUN_DEFAULT);
ASSERT(r == 0);
diff --git a/deps/uv/test/test-ipc.c b/deps/uv/test/test-ipc.c
index 200f68d600..829d178d47 100644
--- a/deps/uv/test/test-ipc.c
+++ b/deps/uv/test/test-ipc.c
@@ -724,6 +724,7 @@ int ipc_helper(int listen_after_write) {
ASSERT(r == 0);
}
+ notify_parent_process();
r = uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(r == 0);
diff --git a/deps/uv/test/test-list.h b/deps/uv/test/test-list.h
index 1bd062da3d..46db4b2710 100644
--- a/deps/uv/test/test-list.h
+++ b/deps/uv/test/test-list.h
@@ -346,6 +346,7 @@ TEST_DECLARE (fs_partial_read)
TEST_DECLARE (fs_partial_write)
TEST_DECLARE (fs_file_pos_after_op_with_offset)
TEST_DECLARE (fs_null_req)
+TEST_DECLARE (fs_read_dir)
#ifdef _WIN32
TEST_DECLARE (fs_exclusive_sharing_mode)
TEST_DECLARE (fs_open_readonly_acl)
@@ -441,6 +442,9 @@ TEST_DECLARE (fork_threadpool_queue_work_simple)
#endif
#endif
+TEST_DECLARE (idna_toascii)
+TEST_DECLARE (utf8_decode1)
+
TASK_LIST_START
TEST_ENTRY_CUSTOM (platform_output, 0, 1, 5000)
@@ -897,6 +901,7 @@ TASK_LIST_START
TEST_ENTRY (fs_read_write_null_arguments)
TEST_ENTRY (fs_file_pos_after_op_with_offset)
TEST_ENTRY (fs_null_req)
+ TEST_ENTRY (fs_read_dir)
#ifdef _WIN32
TEST_ENTRY (fs_exclusive_sharing_mode)
TEST_ENTRY (fs_open_readonly_acl)
@@ -944,6 +949,13 @@ TASK_LIST_START
#endif
#endif
+ TEST_ENTRY (utf8_decode1)
+
+/* Doesn't work on z/OS because that platform uses EBCDIC, not ASCII. */
+#ifndef __MVS__
+ TEST_ENTRY (idna_toascii)
+#endif
+
#if 0
/* These are for testing the test runner. */
TEST_ENTRY (fail_always)
diff --git a/deps/uv/test/test-process-title-threadsafe.c b/deps/uv/test/test-process-title-threadsafe.c
index cc3fd41a13..c0dee48a79 100644
--- a/deps/uv/test/test-process-title-threadsafe.c
+++ b/deps/uv/test/test-process-title-threadsafe.c
@@ -25,11 +25,7 @@
#include <string.h>
-#ifdef __APPLE__
-# define NUM_ITERATIONS 10
-#else
-# define NUM_ITERATIONS 50
-#endif
+#define NUM_ITERATIONS 50
static const char* titles[] = {
"8L2NY0Kdj0XyNFZnmUZigIOfcWjyNr0SkMmUhKw99VLUsZFrvCQQC3XIRfNR8pjyMjXObllled",
diff --git a/deps/uv/test/test-spawn.c b/deps/uv/test/test-spawn.c
index 4fcd905eed..594a64c60b 100644
--- a/deps/uv/test/test-spawn.c
+++ b/deps/uv/test/test-spawn.c
@@ -1172,6 +1172,7 @@ TEST_IMPL(argument_escaping) {
for (i = 0; i < count; ++i) {
free(test_output[i]);
}
+ free(test_output);
result = make_program_args(verbatim, 1, &verbatim_output);
ASSERT(result == 0);
diff --git a/deps/uv/test/test-stdio-over-pipes.c b/deps/uv/test/test-stdio-over-pipes.c
index 1574476104..a130ff6a9b 100644
--- a/deps/uv/test/test-stdio-over-pipes.c
+++ b/deps/uv/test/test-stdio-over-pipes.c
@@ -232,6 +232,7 @@ int stdio_over_pipes_helper(void) {
ASSERT(r == 0);
}
+ notify_parent_process();
uv_run(loop, UV_RUN_DEFAULT);
ASSERT(after_write_called == 7);
diff --git a/deps/uv/test/test.gyp b/deps/uv/test/test.gyp
index 855eda1c50..098512208c 100644
--- a/deps/uv/test/test.gyp
+++ b/deps/uv/test/test.gyp
@@ -46,6 +46,7 @@
'test-homedir.c',
'test-hrtime.c',
'test-idle.c',
+ 'test-idna.c',
'test-ip6-addr.c',
'test-ipc-heavy-traffic-deadlock-bug.c',
'test-ipc-send-recv.c',