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_hwm.cpp | 1 + tests/test_invalid_rep.cpp | 1 + tests/test_pair_inproc.cpp | 1 + tests/test_pair_ipc.cpp | 1 + tests/test_pair_tcp.cpp | 1 + tests/test_reqrep_device.cpp | 1 + tests/test_reqrep_drop.cpp | 1 + tests/test_reqrep_inproc.cpp | 1 + tests/test_reqrep_ipc.cpp | 1 + tests/test_reqrep_tcp.cpp | 1 + tests/test_shutdown_stress.cpp | 1 + tests/test_sub_forward.cpp | 1 + tests/test_timeo.cpp | 1 + tests/testutil.hpp | 1 + 14 files changed, 14 insertions(+) (limited to 'tests') diff --git a/tests/test_hwm.cpp b/tests/test_hwm.cpp index 10b26e1..4f6f8c6 100644 --- a/tests/test_hwm.cpp +++ b/tests/test_hwm.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 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 diff --git a/tests/test_pair_inproc.cpp b/tests/test_pair_inproc.cpp index 6194f2a..8323fe8 100644 --- a/tests/test_pair_inproc.cpp +++ b/tests/test_pair_inproc.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 diff --git a/tests/test_pair_ipc.cpp b/tests/test_pair_ipc.cpp index 2c83a69..b836194 100644 --- a/tests/test_pair_ipc.cpp +++ b/tests/test_pair_ipc.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 diff --git a/tests/test_pair_tcp.cpp b/tests/test_pair_tcp.cpp index 8ecfef5..82596c9 100644 --- a/tests/test_pair_tcp.cpp +++ b/tests/test_pair_tcp.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 diff --git a/tests/test_reqrep_device.cpp b/tests/test_reqrep_device.cpp index f6f06c9..a451956 100644 --- a/tests/test_reqrep_device.cpp +++ b/tests/test_reqrep_device.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 diff --git a/tests/test_reqrep_drop.cpp b/tests/test_reqrep_drop.cpp index 6531357..2829f5f 100644 --- a/tests/test_reqrep_drop.cpp +++ b/tests/test_reqrep_drop.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 diff --git a/tests/test_reqrep_inproc.cpp b/tests/test_reqrep_inproc.cpp index aeff7ef..d47f3f2 100644 --- a/tests/test_reqrep_inproc.cpp +++ b/tests/test_reqrep_inproc.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 diff --git a/tests/test_reqrep_ipc.cpp b/tests/test_reqrep_ipc.cpp index af15998..96cff69 100644 --- a/tests/test_reqrep_ipc.cpp +++ b/tests/test_reqrep_ipc.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 diff --git a/tests/test_reqrep_tcp.cpp b/tests/test_reqrep_tcp.cpp index c713e26..8331c22 100644 --- a/tests/test_reqrep_tcp.cpp +++ b/tests/test_reqrep_tcp.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 diff --git a/tests/test_shutdown_stress.cpp b/tests/test_shutdown_stress.cpp index b3ee90f..65c5a04 100644 --- a/tests/test_shutdown_stress.cpp +++ b/tests/test_shutdown_stress.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 diff --git a/tests/test_sub_forward.cpp b/tests/test_sub_forward.cpp index d69f923..7ed6aa7 100644 --- a/tests/test_sub_forward.cpp +++ b/tests/test_sub_forward.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 diff --git a/tests/test_timeo.cpp b/tests/test_timeo.cpp index a8a3fc0..83d62cc 100644 --- a/tests/test_timeo.cpp +++ b/tests/test_timeo.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 diff --git a/tests/testutil.hpp b/tests/testutil.hpp index 57db3c4..e68dc32 100644 --- a/tests/testutil.hpp +++ b/tests/testutil.hpp @@ -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/Makefile.am | 2 - tests/test_invalid_rep.cpp | 13 ++-- tests/test_reqrep_device.cpp | 31 ++-------- tests/test_reqrep_drop.cpp | 144 ------------------------------------------- 4 files changed, 12 insertions(+), 178 deletions(-) delete mode 100644 tests/test_reqrep_drop.cpp (limited to 'tests') diff --git a/tests/Makefile.am b/tests/Makefile.am index 6ed3762..5f0cfc1 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -7,7 +7,6 @@ noinst_PROGRAMS = test_pair_inproc \ test_reqrep_tcp \ test_hwm \ test_reqrep_device \ - test_reqrep_drop \ test_sub_forward \ test_invalid_rep @@ -24,7 +23,6 @@ test_reqrep_inproc_SOURCES = test_reqrep_inproc.cpp testutil.hpp test_reqrep_tcp_SOURCES = test_reqrep_tcp.cpp testutil.hpp test_hwm_SOURCES = test_hwm.cpp test_reqrep_device_SOURCES = test_reqrep_device.cpp -test_reqrep_drop_SOURCES = test_reqrep_drop.cpp test_sub_forward_SOURCES = test_sub_forward.cpp test_invalid_rep_SOURCES = 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); diff --git a/tests/test_reqrep_device.cpp b/tests/test_reqrep_device.cpp index a451956..4ee7cf2 100644 --- a/tests/test_reqrep_device.cpp +++ b/tests/test_reqrep_device.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. @@ -64,15 +65,11 @@ int main (int argc, char *argv []) assert (rc == 0); rc = zmq_recvmsg (xrep, &msg, 0); assert (rc >= 0); - int rcvlabel; - size_t sz = sizeof (rcvlabel); - rc = zmq_getsockopt (xrep, ZMQ_RCVLABEL, &rcvlabel, &sz); - assert (rc == 0); int rcvmore; + size_t sz = sizeof (rcvmore); rc = zmq_getsockopt (xrep, ZMQ_RCVMORE, &rcvmore, &sz); assert (rc == 0); - rc = zmq_sendmsg (xreq, &msg, - (rcvlabel ? ZMQ_SNDLABEL : 0) | (rcvmore ? ZMQ_SNDMORE : 0)); + rc = zmq_sendmsg (xreq, &msg, rcvmore ? ZMQ_SNDMORE : 0); assert (rc >= 0); } @@ -81,21 +78,14 @@ int main (int argc, char *argv []) rc = zmq_recv (rep, buff, 3, 0); assert (rc == 3); assert (memcmp (buff, "ABC", 3) == 0); - int rcvlabel; - size_t sz = sizeof (rcvlabel); - rc = zmq_getsockopt (rep, ZMQ_RCVLABEL, &rcvlabel, &sz); - assert (rc == 0); - assert (!rcvlabel); int rcvmore; + size_t sz = sizeof (rcvmore); rc = zmq_getsockopt (rep, ZMQ_RCVMORE, &rcvmore, &sz); assert (rc == 0); assert (rcvmore); rc = zmq_recv (rep, buff, 3, 0); assert (rc == 3); assert (memcmp (buff, "DEF", 3) == 0); - rc = zmq_getsockopt (rep, ZMQ_RCVLABEL, &rcvlabel, &sz); - assert (rc == 0); - assert (!rcvlabel); rc = zmq_getsockopt (rep, ZMQ_RCVMORE, &rcvmore, &sz); assert (rc == 0); assert (!rcvmore); @@ -113,15 +103,10 @@ int main (int argc, char *argv []) assert (rc == 0); rc = zmq_recvmsg (xreq, &msg, 0); assert (rc >= 0); - int rcvlabel; - size_t sz = sizeof (rcvlabel); - rc = zmq_getsockopt (xreq, ZMQ_RCVLABEL, &rcvlabel, &sz); - assert (rc == 0); int rcvmore; rc = zmq_getsockopt (xreq, ZMQ_RCVMORE, &rcvmore, &sz); assert (rc == 0); - rc = zmq_sendmsg (xrep, &msg, - (rcvlabel ? ZMQ_SNDLABEL : 0) | (rcvmore ? ZMQ_SNDMORE : 0)); + rc = zmq_sendmsg (xrep, &msg, rcvmore ? ZMQ_SNDMORE : 0); assert (rc >= 0); } @@ -129,18 +114,12 @@ int main (int argc, char *argv []) rc = zmq_recv (req, buff, 3, 0); assert (rc == 3); assert (memcmp (buff, "GHI", 3) == 0); - rc = zmq_getsockopt (req, ZMQ_RCVLABEL, &rcvlabel, &sz); - assert (rc == 0); - assert (!rcvlabel); rc = zmq_getsockopt (req, ZMQ_RCVMORE, &rcvmore, &sz); assert (rc == 0); assert (rcvmore); rc = zmq_recv (req, buff, 3, 0); assert (rc == 3); assert (memcmp (buff, "JKL", 3) == 0); - rc = zmq_getsockopt (req, ZMQ_RCVLABEL, &rcvlabel, &sz); - assert (rc == 0); - assert (!rcvlabel); rc = zmq_getsockopt (req, ZMQ_RCVMORE, &rcvmore, &sz); assert (rc == 0); assert (!rcvmore); diff --git a/tests/test_reqrep_drop.cpp b/tests/test_reqrep_drop.cpp deleted file mode 100644 index 2829f5f..0000000 --- a/tests/test_reqrep_drop.cpp +++ /dev/null @@ -1,144 +0,0 @@ -/* - 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 - - This file is part of 0MQ. - - 0MQ is free software; you can redistribute it and/or modify it under - the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - 0MQ is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with this program. If not, see . -*/ - -#include - -#include "../include/zmq.h" -#include "../include/zmq_utils.h" - -int main (int argc, char *argv []) -{ - void *ctx = zmq_init (1); - assert (ctx); - - // Check whether requests are discarded because of disconnected requester. - - // Create a server. - void *xrep = zmq_socket (ctx, ZMQ_XREP); - assert (xrep); - int rc = zmq_bind (xrep, "tcp://127.0.0.1:5560"); - assert (rc == 0); - - // Create a client. - void *xreq = zmq_socket (ctx, ZMQ_XREQ); - assert (xreq); - rc = zmq_connect (xreq, "tcp://127.0.0.1:5560"); - assert (rc == 0); - - // Send requests. - rc = zmq_send (xreq, "ABC", 3, 0); - assert (rc == 3); - rc = zmq_send (xreq, "DEF", 3, 0); - assert (rc == 3); - - // Disconnect client. - rc = zmq_close (xreq); - assert (rc == 0); - - // Wait a while for disconnect to happen. - zmq_sleep (1); - - // Try to receive a request -- it should have been discarded. - char buff [3]; - rc = zmq_recv (xrep, buff, 3, ZMQ_DONTWAIT); - assert (rc < 0); - assert (errno == EAGAIN); - - // Clean up. - rc = zmq_close (xrep); - assert (rc == 0); - - // New test. Check whether reply is dropped because of HWM overflow. - - int one = 1; - xreq = zmq_socket (ctx, ZMQ_XREQ); - assert (xreq); - rc = zmq_setsockopt (xreq, ZMQ_RCVHWM, &one, sizeof(one)); - assert (rc == 0); - rc = zmq_bind (xreq, "inproc://a"); - assert (rc == 0); - - void *rep = zmq_socket (ctx, ZMQ_REP); - assert (rep); - rc = zmq_setsockopt (rep, ZMQ_SNDHWM, &one, sizeof(one)); - assert (rc == 0); - rc = zmq_connect (rep, "inproc://a"); - assert (rc == 0); - - // Send request 1 - rc = zmq_send (xreq, buff, 1, 0); - assert (rc == 1); - - // Send request 2 - rc = zmq_send (xreq, buff, 1, 0); - assert (rc == 1); - - // Receive request 1 - rc = zmq_recv (rep, buff, 1, 0); - assert (rc == 1); - - // Send request 3 - rc = zmq_send (xreq, buff, 1, 0); - assert (rc == 1); - - // Send reply 1 - rc = zmq_send (rep, buff, 1, 0); - assert (rc == 1); - - // Receive request 2 - rc = zmq_recv (rep, buff, 1, 0); - assert (rc == 1); - - // Send reply 2 - rc = zmq_send (rep, buff, 1, 0); - assert (rc == 1); - - // Receive request 3 - rc = zmq_recv (rep, buff, 1, 0); - assert (rc == 1); - - // Send reply 3 - rc = zmq_send (rep, buff, 1, 0); - assert (rc == 1); - - // Receive reply 1 - rc = zmq_recv (xreq, buff, 1, 0); - assert (rc == 1); - - // Receive reply 2 - rc = zmq_recv (xreq, buff, 1, 0); - assert (rc == 1); - - // Try to receive reply 3, it should have been dropped. - rc = zmq_recv (xreq, buff, 1, ZMQ_DONTWAIT); - assert (rc == -1 && errno == EAGAIN); - - // Clean up. - rc = zmq_close (xreq); - assert (rc == 0); - rc = zmq_close (rep); - assert (rc == 0); - - rc = zmq_term (ctx); - assert (rc == 0); - - return 0 ; -} -- 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_hwm.cpp | 3 +++ tests/test_invalid_rep.cpp | 3 +++ tests/test_pair_inproc.cpp | 3 +++ tests/test_pair_ipc.cpp | 3 +++ tests/test_pair_tcp.cpp | 3 +++ tests/test_reqrep_device.cpp | 3 +++ tests/test_reqrep_inproc.cpp | 3 +++ tests/test_reqrep_ipc.cpp | 3 +++ tests/test_reqrep_tcp.cpp | 3 +++ tests/test_shutdown_stress.cpp | 3 +++ tests/test_sub_forward.cpp | 3 +++ tests/test_timeo.cpp | 3 +++ 12 files changed, 36 insertions(+) (limited to 'tests') diff --git a/tests/test_hwm.cpp b/tests/test_hwm.cpp index 4f6f8c6..eff06fa 100644 --- a/tests/test_hwm.cpp +++ b/tests/test_hwm.cpp @@ -21,11 +21,14 @@ #include +#include #include "testutil.hpp" int main (int argc, char *argv []) { + fprintf (stderr, "test_hwm running...\n"); + void *ctx = zmq_init (1); assert (ctx); 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); diff --git a/tests/test_pair_inproc.cpp b/tests/test_pair_inproc.cpp index 8323fe8..8b54f68 100644 --- a/tests/test_pair_inproc.cpp +++ b/tests/test_pair_inproc.cpp @@ -20,10 +20,13 @@ */ #include +#include #include "testutil.hpp" int main (int argc, char *argv []) { + fprintf (stderr, "test_pair_inproc running...\n"); + void *ctx = zmq_init (0); assert (ctx); diff --git a/tests/test_pair_ipc.cpp b/tests/test_pair_ipc.cpp index b836194..f0be1c6 100644 --- a/tests/test_pair_ipc.cpp +++ b/tests/test_pair_ipc.cpp @@ -20,10 +20,13 @@ */ #include +#include #include "testutil.hpp" int main (int argc, char *argv []) { + fprintf (stderr, "test_pair_ipc running...\n"); + void *ctx = zmq_init (1); assert (ctx); diff --git a/tests/test_pair_tcp.cpp b/tests/test_pair_tcp.cpp index 82596c9..abd7b56 100644 --- a/tests/test_pair_tcp.cpp +++ b/tests/test_pair_tcp.cpp @@ -20,10 +20,13 @@ */ #include +#include #include "testutil.hpp" int main (int argc, char *argv []) { + fprintf (stderr, "test_pair_tcp running...\n"); + void *ctx = zmq_init (1); assert (ctx); diff --git a/tests/test_reqrep_device.cpp b/tests/test_reqrep_device.cpp index 4ee7cf2..8e8eef4 100644 --- a/tests/test_reqrep_device.cpp +++ b/tests/test_reqrep_device.cpp @@ -22,11 +22,14 @@ #include #include +#include #include "../include/zmq.h" int main (int argc, char *argv []) { + fprintf (stderr, "test_reqrep_device running...\n"); + void *ctx = zmq_init (1); assert (ctx); diff --git a/tests/test_reqrep_inproc.cpp b/tests/test_reqrep_inproc.cpp index d47f3f2..bc60381 100644 --- a/tests/test_reqrep_inproc.cpp +++ b/tests/test_reqrep_inproc.cpp @@ -20,10 +20,13 @@ */ #include +#include #include "testutil.hpp" int main (int argc, char *argv []) { + fprintf (stderr, "test_reqrep_inproc running...\n"); + void *ctx = zmq_init (0); assert (ctx); diff --git a/tests/test_reqrep_ipc.cpp b/tests/test_reqrep_ipc.cpp index 96cff69..9644dd1 100644 --- a/tests/test_reqrep_ipc.cpp +++ b/tests/test_reqrep_ipc.cpp @@ -20,10 +20,13 @@ */ #include +#include #include "testutil.hpp" int main (int argc, char *argv []) { + fprintf (stderr, "test_reqrep_ipc running...\n"); + void *ctx = zmq_init (1); assert (ctx); diff --git a/tests/test_reqrep_tcp.cpp b/tests/test_reqrep_tcp.cpp index 8331c22..9f1724e 100644 --- a/tests/test_reqrep_tcp.cpp +++ b/tests/test_reqrep_tcp.cpp @@ -20,10 +20,13 @@ */ #include +#include #include "testutil.hpp" int main (int argc, char *argv []) { + fprintf (stderr, "test_reqrep_tcp running...\n"); + void *ctx = zmq_init (1); assert (ctx); diff --git a/tests/test_shutdown_stress.cpp b/tests/test_shutdown_stress.cpp index 65c5a04..a96c7f6 100644 --- a/tests/test_shutdown_stress.cpp +++ b/tests/test_shutdown_stress.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #define THREAD_COUNT 100 @@ -53,6 +54,8 @@ int main (int argc, char *argv []) int rc; pthread_t threads [THREAD_COUNT]; + fprintf (stderr, "test_shutdown_stress running...\n"); + for (j = 0; j != 10; j++) { // Check the shutdown with many parallel I/O threads. diff --git a/tests/test_sub_forward.cpp b/tests/test_sub_forward.cpp index 7ed6aa7..1a3741c 100644 --- a/tests/test_sub_forward.cpp +++ b/tests/test_sub_forward.cpp @@ -20,12 +20,15 @@ */ #include +#include #include "../include/zmq.h" #include "../include/zmq_utils.h" int main (int argc, char *argv []) { + fprintf (stderr, "test_sub_forward running...\n"); + void *ctx = zmq_init (1); assert (ctx); diff --git a/tests/test_timeo.cpp b/tests/test_timeo.cpp index 83d62cc..f17314e 100644 --- a/tests/test_timeo.cpp +++ b/tests/test_timeo.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include "../include/zmq.h" #include "../include/zmq_utils.h" @@ -46,6 +47,8 @@ extern "C" int main (int argc, char *argv []) { + fprintf (stderr, "test_timeo...\n"); + 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_hwm.cpp | 5 ++--- tests/test_invalid_rep.cpp | 5 ++--- tests/test_pair_inproc.cpp | 5 ++--- tests/test_pair_ipc.cpp | 5 ++--- tests/test_pair_tcp.cpp | 6 +++--- tests/test_reqrep_device.cpp | 5 ++--- tests/test_reqrep_inproc.cpp | 5 ++--- tests/test_reqrep_ipc.cpp | 5 ++--- tests/test_reqrep_tcp.cpp | 6 +++--- tests/test_shutdown_stress.cpp | 6 +++--- tests/test_sub_forward.cpp | 6 +++--- tests/test_timeo.cpp | 5 ++--- 12 files changed, 28 insertions(+), 36 deletions(-) (limited to 'tests') diff --git a/tests/test_hwm.cpp b/tests/test_hwm.cpp index eff06fa..d887b31 100644 --- a/tests/test_hwm.cpp +++ b/tests/test_hwm.cpp @@ -1,7 +1,6 @@ /* - 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 + Copyright (c) 2010-2011 250bpm s.r.o. + Copyright (c) 2010-2011 Other contributors as noted in the AUTHORS file This file is part of 0MQ. 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. diff --git a/tests/test_pair_inproc.cpp b/tests/test_pair_inproc.cpp index 8b54f68..6705cc5 100644 --- a/tests/test_pair_inproc.cpp +++ b/tests/test_pair_inproc.cpp @@ -1,7 +1,6 @@ /* - 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 + Copyright (c) 2010-2011 250bpm s.r.o. + Copyright (c) 2010-2011 Other contributors as noted in the AUTHORS file This file is part of 0MQ. diff --git a/tests/test_pair_ipc.cpp b/tests/test_pair_ipc.cpp index f0be1c6..96a265f 100644 --- a/tests/test_pair_ipc.cpp +++ b/tests/test_pair_ipc.cpp @@ -1,7 +1,6 @@ /* - 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 + Copyright (c) 2010-2011 250bpm s.r.o. + Copyright (c) 2010-2011 Other contributors as noted in the AUTHORS file This file is part of 0MQ. diff --git a/tests/test_pair_tcp.cpp b/tests/test_pair_tcp.cpp index abd7b56..464be5a 100644 --- a/tests/test_pair_tcp.cpp +++ b/tests/test_pair_tcp.cpp @@ -1,7 +1,7 @@ /* - 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 + Copyright (c) 2010-2011 250bpm s.r.o. + Copyright (c) 2011 iMatix Corporation + Copyright (c) 2010-2011 Other contributors as noted in the AUTHORS file This file is part of 0MQ. diff --git a/tests/test_reqrep_device.cpp b/tests/test_reqrep_device.cpp index 8e8eef4..d861cec 100644 --- a/tests/test_reqrep_device.cpp +++ b/tests/test_reqrep_device.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. diff --git a/tests/test_reqrep_inproc.cpp b/tests/test_reqrep_inproc.cpp index bc60381..f710968 100644 --- a/tests/test_reqrep_inproc.cpp +++ b/tests/test_reqrep_inproc.cpp @@ -1,7 +1,6 @@ /* - 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 + Copyright (c) 2010-2011 250bpm s.r.o. + Copyright (c) 2010-2011 Other contributors as noted in the AUTHORS file This file is part of 0MQ. diff --git a/tests/test_reqrep_ipc.cpp b/tests/test_reqrep_ipc.cpp index 9644dd1..fd9b28d 100644 --- a/tests/test_reqrep_ipc.cpp +++ b/tests/test_reqrep_ipc.cpp @@ -1,7 +1,6 @@ /* - 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 + Copyright (c) 2010-2011 250bpm s.r.o. + Copyright (c) 2010-2011 Other contributors as noted in the AUTHORS file This file is part of 0MQ. diff --git a/tests/test_reqrep_tcp.cpp b/tests/test_reqrep_tcp.cpp index 9f1724e..1e6bbbb 100644 --- a/tests/test_reqrep_tcp.cpp +++ b/tests/test_reqrep_tcp.cpp @@ -1,7 +1,7 @@ /* - 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 + Copyright (c) 2010-2011 250bpm s.r.o. + Copyright (c) 2011 iMatix Corporation + Copyright (c) 2010-2011 Other contributors as noted in the AUTHORS file This file is part of 0MQ. diff --git a/tests/test_shutdown_stress.cpp b/tests/test_shutdown_stress.cpp index a96c7f6..811637c 100644 --- a/tests/test_shutdown_stress.cpp +++ b/tests/test_shutdown_stress.cpp @@ -1,7 +1,7 @@ /* - 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 + Copyright (c) 2010-2011 250bpm s.r.o. + Copyright (c) 2011 iMatix Corporation + Copyright (c) 2010-2011 Other contributors as noted in the AUTHORS file This file is part of 0MQ. diff --git a/tests/test_sub_forward.cpp b/tests/test_sub_forward.cpp index 1a3741c..36a7f4a 100644 --- a/tests/test_sub_forward.cpp +++ b/tests/test_sub_forward.cpp @@ -1,7 +1,7 @@ /* - 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 + Copyright (c) 2010-2011 250bpm s.r.o. + Copyright (c) 2011 iMatix Corporation + Copyright (c) 2010-2011 Other contributors as noted in the AUTHORS file This file is part of 0MQ. diff --git a/tests/test_timeo.cpp b/tests/test_timeo.cpp index f17314e..29ba8a0 100644 --- a/tests/test_timeo.cpp +++ b/tests/test_timeo.cpp @@ -1,7 +1,6 @@ /* - 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 + Copyright (c) 2010-2011 250bpm s.r.o. + 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') 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