diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/test-list.h | 2 | ||||
-rw-r--r-- | test/test-signal.c | 20 |
2 files changed, 22 insertions, 0 deletions
diff --git a/test/test-list.h b/test/test-list.h index bc75858f..892a0019 100644 --- a/test/test-list.h +++ b/test/test-list.h @@ -266,6 +266,7 @@ TEST_DECLARE (spawn_tcp_server) TEST_DECLARE (fs_poll) TEST_DECLARE (fs_poll_getpath) TEST_DECLARE (kill) +TEST_DECLARE (kill_invalid_signum) TEST_DECLARE (fs_file_noent) TEST_DECLARE (fs_file_nametoolong) TEST_DECLARE (fs_file_loop) @@ -756,6 +757,7 @@ TASK_LIST_START TEST_ENTRY (fs_poll) TEST_ENTRY (fs_poll_getpath) TEST_ENTRY (kill) + TEST_ENTRY (kill_invalid_signum) TEST_ENTRY (poll_close_doesnt_corrupt_stack) TEST_ENTRY (poll_closesocket) diff --git a/test/test-signal.c b/test/test-signal.c index 9a881510..c2ce5ec0 100644 --- a/test/test-signal.c +++ b/test/test-signal.c @@ -22,6 +22,26 @@ #include "uv.h" #include "task.h" +#ifndef _WIN32 +#include <unistd.h> +#endif + +TEST_IMPL(kill_invalid_signum) { + uv_pid_t pid; + + pid = uv_os_getpid(); + + ASSERT(uv_kill(pid, -1) == UV_EINVAL); +#ifdef _WIN32 + /* NSIG is not available on all platforms. */ + ASSERT(uv_kill(pid, NSIG) == UV_EINVAL); +#endif + ASSERT(uv_kill(pid, 4096) == UV_EINVAL); + + MAKE_VALGRIND_HAPPY(); + return 0; +} + /* For Windows we test only signum handling */ #ifdef _WIN32 static void signum_test_cb(uv_signal_t* handle, int signum) { |