test: fix compilation issues on Windows platform

PR-URL: https://github.com/indutny/uv_link_t/pull/3
This commit is contained in:
Alexey Plotnik 2017-06-12 00:00:34 +10:00 committed by Fedor Indutny
parent a7512f0664
commit 408b8c86dd
7 changed files with 11 additions and 15 deletions

View File

@ -1,2 +1,3 @@
#include "test-common.h"
#include "test-list.h"
#include "mini/main.h"

View File

@ -1,6 +1,3 @@
#include <sys/socket.h>
#include <unistd.h>
#include "test-common.h"
static uv_link_observer_t a;

View File

@ -4,6 +4,14 @@
#include "uv.h"
#include "uv_link_t.h"
#ifdef _WIN32
# include <winsock2.h>
# include <io.h>
#else
# include <sys/socket.h>
# include <unistd.h>
#endif /* _WIN32 */
#include "test-list.h"
#include "mini/test.h"

View File

@ -1,6 +1,3 @@
#include <sys/socket.h>
#include <unistd.h>
#include "test-common.h"
static uv_link_t st_link;

View File

@ -1,6 +1,3 @@
#include <sys/socket.h>
#include <unistd.h>
#include "test-common.h"
static uv_link_t a_link;

View File

@ -1,6 +1,3 @@
#include <sys/socket.h>
#include <unistd.h>
#include "test-common.h"
static uv_link_t source;

View File

@ -1,6 +1,3 @@
#include <sys/socket.h>
#include <unistd.h>
#include "test-common.h"
static int fds[2];
@ -111,6 +108,7 @@ static void close_cb(uv_link_t* link) {
TEST_IMPL(uv_link_source_t) {
#ifndef _WIN32
CHECK_NE(loop = uv_default_loop(), NULL, "uv_default_loop()");
CHECK_EQ(socketpair(AF_UNIX, SOCK_STREAM, 0, fds), 0, "socketpair()");
@ -130,4 +128,5 @@ TEST_IMPL(uv_link_source_t) {
CHECK_EQ(close(fds[0]), 0, "close(fds[0])");
CHECK_NE(close(fds[1]), 0, "close(fds[1]) must fail");
#endif /* !_WIN32 */
}