From 5a8b46e37584f7a24916aeb04e9287cb8a7d6ff0 Mon Sep 17 00:00:00 2001 From: Min RK Date: Wed, 3 Dec 2014 13:58:49 -0800 Subject: [PATCH] allow vanilla socket security tests to run on Windows - add ws2tcpip.h - alias close->closesocket - increment port in sec_null test --- tests/test_security_curve.cpp | 2 ++ tests/test_security_null.cpp | 6 ++++-- tests/test_security_plain.cpp | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/test_security_curve.cpp b/tests/test_security_curve.cpp index 86e72525..50445b0b 100644 --- a/tests/test_security_curve.cpp +++ b/tests/test_security_curve.cpp @@ -20,7 +20,9 @@ #include "testutil.hpp" #if defined (ZMQ_HAVE_WINDOWS) # include +# include # include +# define close closesocket #else # include # include diff --git a/tests/test_security_null.cpp b/tests/test_security_null.cpp index 910073c2..59226c7f 100644 --- a/tests/test_security_null.cpp +++ b/tests/test_security_null.cpp @@ -20,7 +20,9 @@ #include "testutil.hpp" #if defined (ZMQ_HAVE_WINDOWS) # include +# include # include +# define close closesocket #else # include # include @@ -138,14 +140,14 @@ int main (void) assert (server); rc = zmq_setsockopt (server, ZMQ_ZAP_DOMAIN, "WRONG", 5); assert (rc == 0); - rc = zmq_bind (server, "tcp://127.0.0.1:9002"); + rc = zmq_bind (server, "tcp://127.0.0.1:9003"); assert (rc == 0); struct sockaddr_in ip4addr; int s; ip4addr.sin_family = AF_INET; - ip4addr.sin_port = htons(9002); + ip4addr.sin_port = htons(9003); inet_pton(AF_INET, "127.0.0.1", &ip4addr.sin_addr); s = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP); diff --git a/tests/test_security_plain.cpp b/tests/test_security_plain.cpp index a0ceeb14..c9f0b756 100644 --- a/tests/test_security_plain.cpp +++ b/tests/test_security_plain.cpp @@ -20,7 +20,9 @@ #include "testutil.hpp" #if defined (ZMQ_HAVE_WINDOWS) # include +# include # include +# define close closesocket #else # include # include