Commit 230df282 authored by Luca Boccassi's avatar Luca Boccassi

Merge pull request #1920 from somdoron/master

problem: Tests are failing on windows
parents 6f1dc64f 0655ed2e
......@@ -129,9 +129,9 @@ int main (void)
assert (push);
rc = zmq_bind (push, ep_wc_tcp);
assert (rc == 0);
pull = zmq_socket(ctx, ZMQ_PULL);
assert(pull);
#if !defined ZMQ_HAVE_WINDOWS && !defined ZMQ_HAVE_OPENVMS
pull = zmq_socket (ctx, ZMQ_PULL);
assert (pull);
rc = zmq_bind (pull, ep_wc_ipc);
assert (rc == 0);
#endif
......@@ -178,9 +178,9 @@ int main (void)
assert (push);
rc = zmq_bind (push, ep_wc_tcp);
assert (rc == 0);
#if !defined ZMQ_HAVE_WINDOWS && !defined ZMQ_HAVE_OPENVMS
pull = zmq_socket (ctx, ZMQ_PULL);
assert (pull);
pull = zmq_socket(ctx, ZMQ_PULL);
assert(pull);
#if !defined ZMQ_HAVE_WINDOWS && !defined ZMQ_HAVE_OPENVMS
rc = zmq_bind (pull, ep_wc_ipc);
assert (rc == 0);
#endif
......
......@@ -35,19 +35,27 @@ int main (void)
int rc = zmq_bind (sb, "tcp://*:5555");
assert (rc == 0);
char endpoint[256];
size_t endpoint_len = sizeof (endpoint);
rc = zmq_getsockopt (sb, ZMQ_LAST_ENDPOINT, endpoint, &endpoint_len);
char bindEndpoint[256];
size_t endpoint_len = sizeof (bindEndpoint);
rc = zmq_getsockopt (sb, ZMQ_LAST_ENDPOINT, bindEndpoint, &endpoint_len);
assert (rc == 0);
rc = zmq_connect (sc, endpoint);
char connectEndpoint[256];
#ifdef ZMQ_HAVE_WINDOWS
strcpy(connectEndpoint, "tcp://127.0.0.1:5555");
#else
strcpy(connectEndpoint, bindEndpoint);
#endif
rc = zmq_connect (sc, connectEndpoint);
assert (rc == 0);
bounce (sb, sc);
rc = zmq_disconnect (sc, endpoint);
rc = zmq_disconnect (sc, connectEndpoint);
assert (rc == 0);
rc = zmq_unbind (sb, endpoint);
rc = zmq_unbind (sb, bindEndpoint);
assert (rc == 0);
rc = zmq_close (sc);
......@@ -68,20 +76,29 @@ int main (void)
rc = zmq_bind (sb, "tcp://*:5556");
assert (rc == 0);
endpoint_len = sizeof (bindEndpoint);
memset(bindEndpoint, 0, endpoint_len);
rc = zmq_getsockopt (sb, ZMQ_LAST_ENDPOINT, bindEndpoint, &endpoint_len);
assert (rc == 0);
endpoint_len = sizeof (endpoint);
memset(endpoint, 0, endpoint_len);
rc = zmq_getsockopt (sb, ZMQ_LAST_ENDPOINT, endpoint, &endpoint_len);
assert (rc == 0);
#ifdef ZMQ_HAVE_WINDOWS
if (ipv6)
strcpy(connectEndpoint, "tcp://[::1]:5556");
else
strcpy(connectEndpoint, "tcp://127.0.0.1:5556");
#else
strcpy(connectEndpoint, bindEndpoint);
#endif
rc = zmq_connect (sc, endpoint);
rc = zmq_connect (sc, connectEndpoint);
assert (rc == 0);
bounce (sb, sc);
rc = zmq_disconnect (sc, endpoint);
rc = zmq_disconnect (sc, connectEndpoint);
assert (rc == 0);
rc = zmq_unbind (sb, endpoint);
rc = zmq_unbind (sb, bindEndpoint);
assert (rc == 0);
rc = zmq_close (sc);
......@@ -98,6 +115,7 @@ int main (void)
rc = zmq_bind (sb, "tcp://127.0.0.1:*");
assert (rc == 0);
char endpoint[256];
endpoint_len = sizeof (endpoint);
memset(endpoint, 0, endpoint_len);
rc = zmq_getsockopt (sb, ZMQ_LAST_ENDPOINT, endpoint, &endpoint_len);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment