diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/run-tests.c | 2 | ||||
-rw-r--r-- | test/task.h | 2 | ||||
-rw-r--r-- | test/test-embed.c | 4 | ||||
-rw-r--r-- | test/test-fs.c | 14 | ||||
-rw-r--r-- | test/test-poll.c | 14 | ||||
-rw-r--r-- | test/test-process-priority.c | 4 | ||||
-rw-r--r-- | test/test-process-title-threadsafe.c | 10 | ||||
-rw-r--r-- | test/test-process-title.c | 2 | ||||
-rw-r--r-- | test/test-spawn.c | 2 | ||||
-rw-r--r-- | test/test-tcp-flags.c | 15 | ||||
-rw-r--r-- | test/test-udp-ipv6.c | 6 | ||||
-rw-r--r-- | test/test-udp-multicast-join.c | 4 | ||||
-rw-r--r-- | test/test-udp-multicast-join6.c | 6 |
13 files changed, 60 insertions, 25 deletions
diff --git a/test/run-tests.c b/test/run-tests.c index 17fb0e0c..a5007e24 100644 --- a/test/run-tests.c +++ b/test/run-tests.c @@ -223,7 +223,7 @@ static int maybe_run_test(int argc, char **argv) { ASSERT_GT((intptr_t) closed_fd, 0); ASSERT_GT((intptr_t) open_fd, 0); ASSERT_NE(0, GetHandleInformation(open_fd, &flags)); - kernelbase_module = GetModuleHandleA("kernelbase.dll"); + kernelbase_module = GetModuleHandleW(L"kernelbase.dll"); pCompareObjectHandles = (sCompareObjectHandles) GetProcAddress(kernelbase_module, "CompareObjectHandles"); ASSERT_NE(pCompareObjectHandles == NULL || \ diff --git a/test/task.h b/test/task.h index e25a9c9a..d3eeaf77 100644 --- a/test/task.h +++ b/test/task.h @@ -358,7 +358,7 @@ UNUSED static int can_ipv6(void) { return supported; } -#if defined(__CYGWIN__) || defined(__MSYS__) || defined(__PASE__) +#if defined(__CYGWIN__) || defined(__MSYS__) || defined(__PASE__) || defined(__QNX__) # define NO_FS_EVENTS "Filesystem watching not supported on this platform." #endif diff --git a/test/test-embed.c b/test/test-embed.c index 6e991723..84fc7cad 100644 --- a/test/test-embed.c +++ b/test/test-embed.c @@ -25,7 +25,7 @@ #include <stdlib.h> #include <errno.h> -#if !defined(_WIN32) && !defined(_AIX) +#if !defined(_WIN32) && !defined(_AIX) && !defined(__QNX__) #include <poll.h> #endif @@ -56,7 +56,7 @@ TEST_IMPL(embed) { ASSERT_LE(0, uv_barrier_wait(&barrier)); while (uv_loop_alive(loop)) { -#if defined(_WIN32) || defined(_AIX) +#if defined(_WIN32) || defined(_AIX) || defined(__QNX__) ASSERT_LE(0, uv_run(loop, UV_RUN_ONCE)); #else int rc; diff --git a/test/test-fs.c b/test/test-fs.c index 4761b15b..4ce059c3 100644 --- a/test/test-fs.c +++ b/test/test-fs.c @@ -152,7 +152,7 @@ int uv_test_getiovmax(void) { int uv_test_getiovmax(void) { #if defined(IOV_MAX) return IOV_MAX; -#elif defined(_SC_IOV_MAX) +#elif defined(_SC_IOV_MAX) && !defined(__QNX__) static int iovmax = -1; if (iovmax == -1) { iovmax = sysconf(_SC_IOV_MAX); @@ -356,7 +356,7 @@ static void statfs_cb(uv_fs_t* req) { stats = req->ptr; #if defined(_WIN32) || defined(__sun) || defined(_AIX) || defined(__MVS__) || \ - defined(__OpenBSD__) || defined(__NetBSD__) + defined(__OpenBSD__) || defined(__NetBSD__) || defined(__QNX__) ASSERT_OK(stats->f_type); #else ASSERT_UINT64_GT(stats->f_type, 0); @@ -2833,7 +2833,9 @@ TEST_IMPL(fs_utime_round) { double mtime; uv_fs_t req; int r; - +#if defined(__QNX__) + RETURN_SKIP("Setting time to a negative value is unsupported on QNX"); +#endif loop = uv_default_loop(); unlink(path); r = uv_fs_open(NULL, &req, path, UV_FS_O_RDWR | UV_FS_O_CREAT, @@ -3889,6 +3891,12 @@ TEST_IMPL(fs_read_dir) { * created on. That is why this assertion is a bit lenient. */ ASSERT((r >= 0) || (r == UV_EISDIR)); +#elif defined(__QNX__) + /* + * If UV_FS_O_DIRECTORY is supplied, QNX returns ENOSYS. Otherwise + * UV_EISDIR is returned. Here we are lenient and accept both. + */ + ASSERT((r == UV_ENOSYS) || (r == UV_EISDIR)); #else ASSERT_EQ(r, UV_EISDIR); #endif diff --git a/test/test-poll.c b/test/test-poll.c index 5161de25..11974424 100644 --- a/test/test-poll.c +++ b/test/test-poll.c @@ -83,9 +83,9 @@ static int closed_connections = 0; static int valid_writable_wakeups = 0; static int spurious_writable_wakeups = 0; -#if !defined(__sun) && !defined(_AIX) && !defined(__MVS__) +#if !defined(__sun) && !defined(_AIX) && !defined(__MVS__) && !defined(__QNX__) static int disconnects = 0; -#endif /* !__sun && !_AIX && !__MVS__ */ +#endif /* !__sun && !_AIX && !__MVS__ && !__QNX__*/ static int got_eagain(void) { #ifdef _WIN32 @@ -409,7 +409,7 @@ static void connection_poll_cb(uv_poll_t* handle, int status, int events) { new_events &= ~UV_WRITABLE; } } -#if !defined(__sun) && !defined(_AIX) && !defined(__MVS__) +#if !defined(__sun) && !defined(_AIX) && !defined(__MVS__) && !defined(__QNX__) if (events & UV_DISCONNECT) { context->got_disconnect = 1; ++disconnects; @@ -417,9 +417,9 @@ static void connection_poll_cb(uv_poll_t* handle, int status, int events) { } if (context->got_fin && context->sent_fin && context->got_disconnect) { -#else /* __sun && _AIX && __MVS__ */ +#else /* __sun && _AIX && __MVS__ && __QNX__*/ if (context->got_fin && context->sent_fin) { -#endif /* !__sun && !_AIX && !__MVS__ */ +#endif /* !__sun && !_AIX && !__MVS__ && !__QNX__ */ /* Sent and received FIN. Close and destroy context. */ close_socket(context->sock); destroy_connection_context(context); @@ -587,7 +587,7 @@ static void start_poll_test(void) { spurious_writable_wakeups > 20, 0); ASSERT_EQ(closed_connections, NUM_CLIENTS * 2); -#if !defined(__sun) && !defined(_AIX) && !defined(__MVS__) +#if !defined(__sun) && !defined(_AIX) && !defined(__MVS__) && !defined(__QNX__) ASSERT_EQ(disconnects, NUM_CLIENTS * 2); #endif MAKE_VALGRIND_HAPPY(uv_default_loop()); @@ -638,7 +638,7 @@ TEST_IMPL(poll_unidirectional) { TEST_IMPL(poll_bad_fdtype) { #if !defined(__sun) && \ !defined(_AIX) && !defined(__MVS__) && \ - !defined(__CYGWIN__) && !defined(__MSYS__) + !defined(__CYGWIN__) && !defined(__MSYS__) && !defined(__QNX__) uv_poll_t poll_handle; int fd[2]; diff --git a/test/test-process-priority.c b/test/test-process-priority.c index 941e4b36..5e61ef4c 100644 --- a/test/test-process-priority.c +++ b/test/test-process-priority.c @@ -28,9 +28,9 @@ TEST_IMPL(process_priority) { int r; int i; -#if defined(__MVS__) +#if defined(__MVS__) || defined(__QNX__) if (uv_os_setpriority(0, 0) == UV_ENOSYS) - RETURN_SKIP("functionality not supported on zOS"); + RETURN_SKIP("functionality not supported on zOS and QNX"); #endif /* Verify that passing a NULL pointer returns UV_EINVAL. */ diff --git a/test/test-process-title-threadsafe.c b/test/test-process-title-threadsafe.c index 05baaf44..212c715a 100644 --- a/test/test-process-title-threadsafe.c +++ b/test/test-process-title-threadsafe.c @@ -85,10 +85,18 @@ TEST_IMPL(process_title_threadsafe) { int i; #if defined(__sun) || defined(__CYGWIN__) || defined(__MSYS__) || \ - defined(__MVS__) || defined(__PASE__) + defined(__MVS__) || defined(__PASE__) || defined(__QNX__) RETURN_SKIP("uv_(get|set)_process_title is not implemented."); #endif +#if defined(__ASAN__) && defined(__APPLE__) + /* uv_set_process_title loads and unloads a bunch of dynamic libraries, + * and that's quite slow and prone to time out when running concurrently + * under AddressSanitizer. + */ + RETURN_SKIP("too slow under ASAN"); +#endif + ASSERT_OK(uv_set_process_title(titles[0])); ASSERT_OK(uv_sem_init(&getter_sem, 0)); diff --git a/test/test-process-title.c b/test/test-process-title.c index 7178cf87..3478033a 100644 --- a/test/test-process-title.c +++ b/test/test-process-title.c @@ -61,7 +61,7 @@ static void uv_get_process_title_edge_cases(void) { TEST_IMPL(process_title) { #if defined(__sun) || defined(__CYGWIN__) || defined(__MSYS__) || \ - defined(__PASE__) + defined(__PASE__) || defined(__QNX__) RETURN_SKIP("uv_(get|set)_process_title is not implemented."); #endif diff --git a/test/test-spawn.c b/test/test-spawn.c index 964c8a86..0dad9bcd 100644 --- a/test/test-spawn.c +++ b/test/test-spawn.c @@ -1701,7 +1701,7 @@ TEST_IMPL(spawn_fs_open) { #ifdef _WIN32 ASSERT_NE(0, DuplicateHandle(GetCurrentProcess(), fd, GetCurrentProcess(), &dup_fd, 0, /* inherit */ TRUE, DUPLICATE_SAME_ACCESS)); - kernelbase_module = GetModuleHandleA("kernelbase.dll"); + kernelbase_module = GetModuleHandleW(L"kernelbase.dll"); pCompareObjectHandles = (sCompareObjectHandles) GetProcAddress(kernelbase_module, "CompareObjectHandles"); ASSERT_NE(pCompareObjectHandles == NULL || diff --git a/test/test-tcp-flags.c b/test/test-tcp-flags.c index 16218a27..04a238b2 100644 --- a/test/test-tcp-flags.c +++ b/test/test-tcp-flags.c @@ -49,6 +49,21 @@ TEST_IMPL(tcp_flags) { r = uv_tcp_keepalive(&handle, 1, 0); ASSERT_EQ(r, UV_EINVAL); + r = uv_tcp_keepalive_ex(&handle, 1, 60, 60, 60); + ASSERT_OK(r); + + r = uv_tcp_keepalive_ex(&handle, 0, 0, 0, 0); + ASSERT_OK(r); + + r = uv_tcp_keepalive_ex(&handle, 1, 0, 10, 10); + ASSERT_EQ(r, UV_EINVAL); + + r = uv_tcp_keepalive_ex(&handle, 1, 10, 0, 10); + ASSERT_EQ(r, UV_EINVAL); + + r = uv_tcp_keepalive_ex(&handle, 1, 10, 10, 0); + ASSERT_EQ(r, UV_EINVAL); + uv_close((uv_handle_t*)&handle, NULL); r = uv_run(loop, UV_RUN_DEFAULT); diff --git a/test/test-udp-ipv6.c b/test/test-udp-ipv6.c index 8ad80b9b..e21ad0aa 100644 --- a/test/test-udp-ipv6.c +++ b/test/test-udp-ipv6.c @@ -26,7 +26,7 @@ #include <stdlib.h> #include <string.h> -#if defined(__FreeBSD__) || defined(__NetBSD__) +#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__QNX__) #include <sys/sysctl.h> #endif @@ -49,7 +49,7 @@ static int recv_cb_called; static int close_cb_called; static uint16_t client_port; -#if defined(__FreeBSD__) || defined(__NetBSD__) +#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__QNX__) static int can_ipv6_ipv4_dual(void) { int v6only; size_t size = sizeof(int); @@ -228,7 +228,7 @@ TEST_IMPL(udp_dual_stack) { if (!can_ipv6()) RETURN_SKIP("IPv6 not supported"); -#if defined(__FreeBSD__) || defined(__NetBSD__) +#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__QNX__) if (!can_ipv6_ipv4_dual()) RETURN_SKIP("IPv6-IPv4 dual stack not supported"); #elif defined(__OpenBSD__) diff --git a/test/test-udp-multicast-join.c b/test/test-udp-multicast-join.c index f024e2e0..548bf741 100644 --- a/test/test-udp-multicast-join.c +++ b/test/test-udp-multicast-join.c @@ -144,8 +144,8 @@ static void cl_recv_cb(uv_udp_t* handle, TEST_IMPL(udp_multicast_join) { -#if defined(__OpenBSD__) - RETURN_SKIP("Test does not currently work in OpenBSD"); +#if defined(__OpenBSD__) || defined(QNX_IOPKT) + RETURN_SKIP("Test does not currently work in OpenBSD or QNX"); #endif int r; struct sockaddr_in addr; diff --git a/test/test-udp-multicast-join6.c b/test/test-udp-multicast-join6.c index 430e4e33..c7d62431 100644 --- a/test/test-udp-multicast-join6.c +++ b/test/test-udp-multicast-join6.c @@ -35,7 +35,8 @@ defined(__MVS__) || \ defined(__FreeBSD__) || \ defined(__NetBSD__) || \ - defined(__OpenBSD__) + defined(__OpenBSD__) || \ + defined(__QNX__) #define MULTICAST_ADDR "ff02::1%lo0" #define INTERFACE_ADDR "::1%lo0" #else @@ -167,6 +168,9 @@ static int can_ipv6_external(void) { TEST_IMPL(udp_multicast_join6) { +#if defined(QNX_IOPKT) + RETURN_SKIP("Test does not currently work in QNX"); +#endif int r; struct sockaddr_in6 addr; |