summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2011-11-04 08:00:47 +0100
committerMartin Sustrik <sustrik@250bpm.com>2011-11-04 08:00:47 +0100
commita4843b65d24f9caa188bb2454b28080f0cee8484 (patch)
tree9fb56a811f693c968074433fe899ce7dd55a76fe /tests
parentd20ea25b8c63e148fe48cc2b85bac9c896f1073b (diff)
Identities re-introduced
However, the "durable socket" behaviour wasn't re-added. Identities are used solely for routing in REQ/REP pattern. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/test_invalid_rep.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/tests/test_invalid_rep.cpp b/tests/test_invalid_rep.cpp
index ada7ee1..9c77cc4 100644
--- a/tests/test_invalid_rep.cpp
+++ b/tests/test_invalid_rep.cpp
@@ -25,7 +25,7 @@
int main (int argc, char *argv [])
{
- fprintf (stderr, "test_pair_inproc running...\n");
+ fprintf (stderr, "test_invalid_rep running...\n");
// Create REQ/XREP wiring.
void *ctx = zmq_init (1);
@@ -49,23 +49,24 @@ int main (int argc, char *argv [])
assert (rc == 1);
// Receive the request.
- char addr [4];
+ char addr [32];
+ int addr_size;
char bottom [1];
char body [1];
- rc = zmq_recv (xrep_socket, addr, sizeof (addr), 0);
- assert (rc == 4);
+ addr_size = zmq_recv (xrep_socket, addr, sizeof (addr), 0);
+ assert (addr_size >= 0);
rc = zmq_recv (xrep_socket, bottom, sizeof (bottom), 0);
assert (rc == 0);
rc = zmq_recv (xrep_socket, body, sizeof (body), 0);
assert (rc == 1);
// Send invalid reply.
- rc = zmq_send (xrep_socket, addr, 4, 0);
- assert (rc == 4);
+ rc = zmq_send (xrep_socket, addr, addr_size, 0);
+ assert (rc == addr_size);
// Send valid reply.
- rc = zmq_send (xrep_socket, addr, 4, ZMQ_SNDMORE);
- assert (rc == 4);
+ rc = zmq_send (xrep_socket, addr, addr_size, ZMQ_SNDMORE);
+ assert (rc == addr_size);
rc = zmq_send (xrep_socket, bottom, 0, ZMQ_SNDMORE);
assert (rc == 0);
rc = zmq_send (xrep_socket, "b", 1, 0);