about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--test/src/main.c1
-rw-r--r--test/src/test-close.c3
-rw-r--r--test/src/test-common.h8
-rw-r--r--test/src/test-defaults.c3
-rw-r--r--test/src/test-strerror.c3
-rw-r--r--test/src/test-uv-link-observer-t.c3
-rw-r--r--test/src/test-uv-link-source-t.c5
7 files changed, 11 insertions, 15 deletions
diff --git a/test/src/main.c b/test/src/main.c
index a1c8550..3c9cf8c 100644
--- a/test/src/main.c
+++ b/test/src/main.c
@@ -1,2 +1,3 @@
+#include "test-common.h"
 #include "test-list.h"
 #include "mini/main.h"
diff --git a/test/src/test-close.c b/test/src/test-close.c
index 4f10630..e24a94d 100644
--- a/test/src/test-close.c
+++ b/test/src/test-close.c
@@ -1,6 +1,3 @@
-#include <sys/socket.h>
-#include <unistd.h>
-
 #include "test-common.h"
 
 static uv_link_observer_t a;
diff --git a/test/src/test-common.h b/test/src/test-common.h
index b780c64..947f087 100644
--- a/test/src/test-common.h
+++ b/test/src/test-common.h
@@ -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"
 
diff --git a/test/src/test-defaults.c b/test/src/test-defaults.c
index 909594c..8e2de9b 100644
--- a/test/src/test-defaults.c
+++ b/test/src/test-defaults.c
@@ -1,6 +1,3 @@
-#include <sys/socket.h>
-#include <unistd.h>
-
 #include "test-common.h"
 
 static uv_link_t st_link;
diff --git a/test/src/test-strerror.c b/test/src/test-strerror.c
index d2e307c..c79544c 100644
--- a/test/src/test-strerror.c
+++ b/test/src/test-strerror.c
@@ -1,6 +1,3 @@
-#include <sys/socket.h>
-#include <unistd.h>
-
 #include "test-common.h"
 
 static uv_link_t a_link;
diff --git a/test/src/test-uv-link-observer-t.c b/test/src/test-uv-link-observer-t.c
index d81b679..b6df8d9 100644
--- a/test/src/test-uv-link-observer-t.c
+++ b/test/src/test-uv-link-observer-t.c
@@ -1,6 +1,3 @@
-#include <sys/socket.h>
-#include <unistd.h>
-
 #include "test-common.h"
 
 static uv_link_t source;
diff --git a/test/src/test-uv-link-source-t.c b/test/src/test-uv-link-source-t.c
index 4024f5f..8e3e773 100644
--- a/test/src/test-uv-link-source-t.c
+++ b/test/src/test-uv-link-source-t.c
@@ -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 */
 }