From ac7717b7b35f441fc3aeeb1528e63f147c00913a Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Mon, 31 Oct 2011 16:20:30 +0100 Subject: 250bpm copyrights added Signed-off-by: Martin Sustrik --- tests/test_invalid_rep.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/test_invalid_rep.cpp') diff --git a/tests/test_invalid_rep.cpp b/tests/test_invalid_rep.cpp index 2657c20..dc902c2 100644 --- a/tests/test_invalid_rep.cpp +++ b/tests/test_invalid_rep.cpp @@ -1,4 +1,5 @@ /* + Copyright (c) 2009-2011 250bpm s.r.o. Copyright (c) 2007-2011 iMatix Corporation Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file -- cgit v1.2.3 From 7842c7107358324e8c5b9af7272e6dcab8c97931 Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Tue, 1 Nov 2011 13:39:54 +0100 Subject: LABELS and COMMANDs removed Signed-off-by: Martin Sustrik --- tests/test_invalid_rep.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'tests/test_invalid_rep.cpp') diff --git a/tests/test_invalid_rep.cpp b/tests/test_invalid_rep.cpp index dc902c2..f158b05 100644 --- a/tests/test_invalid_rep.cpp +++ b/tests/test_invalid_rep.cpp @@ -1,6 +1,7 @@ /* Copyright (c) 2009-2011 250bpm s.r.o. Copyright (c) 2007-2011 iMatix Corporation + Copyright (c) 2011 VMware, Inc. Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file This file is part of 0MQ. @@ -47,12 +48,12 @@ int main (int argc, char *argv []) // Receive the request. char addr [4]; - char seqn [4]; + char bottom [1]; char body [1]; rc = zmq_recv (xrep_socket, addr, sizeof (addr), 0); assert (rc == 4); - rc = zmq_recv (xrep_socket, seqn, sizeof (seqn), 0); - assert (rc == 4); + rc = zmq_recv (xrep_socket, bottom, sizeof (bottom), 0); + assert (rc == 0); rc = zmq_recv (xrep_socket, body, sizeof (body), 0); assert (rc == 1); @@ -61,10 +62,10 @@ int main (int argc, char *argv []) assert (rc == 4); // Send valid reply. - rc = zmq_send (xrep_socket, addr, 4, ZMQ_SNDLABEL); - assert (rc == 4); - rc = zmq_send (xrep_socket, seqn, 4, ZMQ_SNDLABEL); + rc = zmq_send (xrep_socket, addr, 4, ZMQ_SNDMORE); assert (rc == 4); + rc = zmq_send (xrep_socket, bottom, 0, ZMQ_SNDMORE); + assert (rc == 0); rc = zmq_send (xrep_socket, "b", 1, 0); assert (rc == 1); -- cgit v1.2.3 From 7563518929573fc9e729c1dc8bb4aea512fada5a Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Tue, 1 Nov 2011 13:54:28 +0100 Subject: Tests print their name before running This makes finding out which test have hung-up easier. Signed-off-by: Martin Sustrik --- tests/test_invalid_rep.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests/test_invalid_rep.cpp') diff --git a/tests/test_invalid_rep.cpp b/tests/test_invalid_rep.cpp index f158b05..2cab713 100644 --- a/tests/test_invalid_rep.cpp +++ b/tests/test_invalid_rep.cpp @@ -22,9 +22,12 @@ #include "../include/zmq.h" #include +#include int main (int argc, char *argv []) { + fprintf (stderr, "test_pair_inproc running...\n"); + // Create REQ/XREP wiring. void *ctx = zmq_init (1); assert (ctx); -- cgit v1.2.3 From 8e21d64c974344b5b2b83cac85d12c51392fe74b Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Tue, 1 Nov 2011 18:06:11 +0100 Subject: Copyright dates adjusted to reflect reality Signed-off-by: Martin Sustrik --- tests/test_invalid_rep.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'tests/test_invalid_rep.cpp') diff --git a/tests/test_invalid_rep.cpp b/tests/test_invalid_rep.cpp index 2cab713..ada7ee1 100644 --- a/tests/test_invalid_rep.cpp +++ b/tests/test_invalid_rep.cpp @@ -1,8 +1,7 @@ /* - Copyright (c) 2009-2011 250bpm s.r.o. - Copyright (c) 2007-2011 iMatix Corporation + Copyright (c) 2010-2011 250bpm s.r.o. Copyright (c) 2011 VMware, Inc. - Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file + Copyright (c) 2010-2011 Other contributors as noted in the AUTHORS file This file is part of 0MQ. -- cgit v1.2.3 From a4843b65d24f9caa188bb2454b28080f0cee8484 Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Fri, 4 Nov 2011 08:00:47 +0100 Subject: 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 --- tests/test_invalid_rep.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'tests/test_invalid_rep.cpp') 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); -- cgit v1.2.3