Permalink
Browse files

Added test case for 207

  • Loading branch information...
hintjens committed Aug 30, 2011
1 parent ba01930 commit 7caae6c6382a7acbcf2dcc354f7ec9aa38a88305
Showing with 42 additions and 0 deletions.
  1. +21 −0 207/2-1/issue.c
  2. +21 −0 207/3-0/issue.c
View
@@ -0,0 +1,21 @@
+#include "zmq.h"
+#include "assert.h"
+#include "stdio.h"
+
+int main (void)
+{
+ void *context = zmq_init (1);
+ void *client = zmq_socket (context, ZMQ_PULL);
+ int rc = zmq_connect (client, "tcp://localhost:localhost");
+ assert (rc == -1);
+ rc = zmq_connect (client, "tcp://invalid:address");
+ assert (rc == -1);
+ rc = zmq_connect (client, "tcp://imatix.invalid:9000");
+ assert (rc == -1);
+
+ int linger = 0;
+ zmq_setsockopt (client, ZMQ_LINGER, &linger, sizeof (int));
+ zmq_close (client);
+ zmq_term (context);
+ return 0;
+}
View
@@ -0,0 +1,21 @@
+#include "zmq.h"
+#include "assert.h"
+#include "stdio.h"
+
+int main (void)
+{
+ void *context = zmq_init (1);
+ void *client = zmq_socket (context, ZMQ_PULL);
+ int rc = zmq_connect (client, "tcp://localhost:localhost");
+ assert (rc == -1);
+ rc = zmq_connect (client, "tcp://invalid:address");
+ assert (rc == -1);
+ rc = zmq_connect (client, "tcp://imatix.invalid:9000");
+ assert (rc == -1);
+
+ int linger = 0;
+ zmq_setsockopt (client, ZMQ_LINGER, &linger, sizeof (int));
+ zmq_close (client);
+ zmq_term (context);
+ return 0;
+}

0 comments on commit 7caae6c

Please sign in to comment.