Permalink
Browse files

Added testcase for issue #872

  • Loading branch information...
1 parent 1e6773f commit 58bd49421e8b2d06761eda838cbe311b754d7f62 @hintjens hintjens committed Feb 4, 2014
Showing with 24 additions and 0 deletions.
  1. +24 −0 872/issue.c
View
@@ -0,0 +1,24 @@
+#include <czmq.h>
+
+int main (void)
+{
+ void *ctx = zmq_ctx_new ();
+ void *sender = zmq_socket (ctx, ZMQ_DEALER);
+ zmq_connect(sender, "inproc://aa");
+
+ // If first part is empty, receiver gets identity frame instead
+ // else does not get identity frame, but does get first part.
+ zmq_send (sender, "a", 0, ZMQ_SNDMORE);
+ zmq_send (sender, "b", 1, ZMQ_SNDMORE);
+ zmq_send (sender, "123", 3, 0);
+
+ void *receiver = zmq_socket (ctx, ZMQ_ROUTER);
+ zmq_bind (receiver, "inproc://aa");
+
+ zmsg_t *msg = zmsg_recv (receiver);
+ zmsg_dump (msg);
+ assert (zmsg_size (msg) == 4);
+ zmsg_destroy (&msg);
+
+ return 0;
+}

0 comments on commit 58bd494

Please sign in to comment.