From e8aeb3686d1d8af1c3fe091d1d42ce4cee10f3d3 Mon Sep 17 00:00:00 2001 From: hitstergtd Date: Thu, 21 Apr 2016 13:08:50 +0100 Subject: [PATCH] Problem: ZMQ_SRCFD test does not work on Windows Solution: add Winsock specific assertions, since getpeername() should will return SOCKET_ERROR (-1) and WSAGetLastError() will be set to WSAENOTSOCK --- tests/test_srcfd.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/test_srcfd.cpp b/tests/test_srcfd.cpp index f99ec81e..3e7ccb99 100644 --- a/tests/test_srcfd.cpp +++ b/tests/test_srcfd.cpp @@ -105,8 +105,13 @@ int main (void) // getting name from closed socket will fail rc = getpeername (srcFd, (struct sockaddr*) &ss, &addrlen); +#ifdef ZMQ_HAVE_WINDOWS + assert (rc == SOCKET_ERROR); + assert (WSAGetLastError() == WSAENOTSOCK); +#else assert (rc == -1); assert (errno == EBADF); +#endif rc = zmq_ctx_term (ctx); assert (rc == 0);