0
0
mirror of https://github.com/zeromq/libzmq.git synced 2024-12-27 07:31:03 +08:00

Problem: default test setUp/tearDown functions duplicated in many test programs

Solution: define setUp/tearDown functions via SETUP_TEARDOWN_TESTCONTEXT macro where possible
This commit is contained in:
Simon Giesecke 2019-03-24 12:51:28 -04:00
parent 2b80dd7add
commit af4fa22fd8
87 changed files with 92 additions and 851 deletions

View File

@ -31,17 +31,8 @@
#include "testutil_unity.hpp"
#include <string.h>
#include <unity.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
static const char test_endpoint[] = "ipc://@tmp-tester";

View File

@ -30,17 +30,7 @@
#include "testutil.hpp"
#include "testutil_unity.hpp"
#include <unity.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
void test_x ()
{

View File

@ -30,17 +30,7 @@
#include "testutil.hpp"
#include "testutil_unity.hpp"
#include <unity.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
void test_x ()
{

View File

@ -30,17 +30,7 @@
#include "testutil.hpp"
#include "testutil_unity.hpp"
#include <unity.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
void create_inproc_client_server_pair (void **server_, void **client_)
{

View File

@ -30,17 +30,7 @@
#include "testutil.hpp"
#include "testutil_unity.hpp"
#include <unity.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
void test_x ()
{

View File

@ -31,17 +31,7 @@
#include "testutil_unity.hpp"
#include "testutil_security.hpp"
#include <unity.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
void test_send_one_connected_one_unconnected ()
{

View File

@ -32,15 +32,7 @@
#include <string.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
const char *rconn1routing_id = "conn1";
const char *x_routing_id = "X";

View File

@ -31,15 +31,7 @@
#include "testutil.hpp"
#include "testutil_unity.hpp"
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
#define WAIT_FOR_BACKGROUND_THREAD_INSPECTION (0)

View File

@ -32,17 +32,8 @@
#include <stdlib.h>
#include <string.h>
#include <unity.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
void str_send_to (void *s_, const char *content_, const char *address_)
{

View File

@ -30,17 +30,7 @@
#include "testutil.hpp"
#include "testutil_unity.hpp"
#include <unity.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
void test_diffserv ()
{

View File

@ -32,15 +32,7 @@
#include <string.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
/// Initialize a zeromq message with a given null-terminated string
#define ZMQ_PREPARE_STRING(msg, data, size) \

View File

@ -33,15 +33,7 @@
#include <unistd.h>
#include <grp.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
static void bounce_fail (void *server_, void *client_)
{

View File

@ -36,15 +36,7 @@
#include <unistd.h>
#include <sys/wait.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
char connect_address[MAX_SOCKET_STRING];

View File

@ -26,15 +26,8 @@
#include "testutil_unity.hpp"
#include <string.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
void test_getsockopt_memset ()
{

View File

@ -42,16 +42,7 @@ typedef int raw_socket;
#include "testutil_unity.hpp"
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
// Read one event off the monitor socket; return value and address
// by reference, if not null, and event number by value. Returns -1

View File

@ -30,17 +30,7 @@
#include "testutil.hpp"
#include "testutil_unity.hpp"
#include <unity.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
const int MAX_SENDS = 10000;

View File

@ -36,15 +36,7 @@
// ensure we have extra space for that:
#define SOCKET_STRING_LEN (MAX_SOCKET_STRING * 4)
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
int test_defaults (int send_hwm_, int msg_cnt_, const char *endpoint)
{

View File

@ -30,17 +30,7 @@
#include "testutil.hpp"
#include "testutil_unity.hpp"
#include <unity.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
void test_immediate_1 ()
{

View File

@ -30,15 +30,7 @@
#include "testutil.hpp"
#include "testutil_unity.hpp"
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
static void pusher (void * /*unused*/)
{

View File

@ -30,17 +30,7 @@
#include "testutil.hpp"
#include "testutil_unity.hpp"
#include <unity.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
void test_invalid_rep ()
{

View File

@ -32,17 +32,8 @@
#include <stdlib.h>
#include <string.h>
#include <unity.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
// XSI vector I/O
#if defined ZMQ_HAVE_UIO

View File

@ -30,17 +30,7 @@
#include "testutil.hpp"
#include "testutil_unity.hpp"
#include <unity.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
void test_ipc_wildcard ()
{

View File

@ -30,17 +30,7 @@
#include "testutil.hpp"
#include "testutil_unity.hpp"
#include <unity.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
// Issue 566 describes a problem in libzmq v4.0.0 where a dealer to router
// connection would fail randomly. The test works when the two sockets are

View File

@ -30,17 +30,7 @@
#include "testutil.hpp"
#include "testutil_unity.hpp"
#include <unity.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
static void do_bind_and_verify (void *s_, const char *endpoint_)
{

View File

@ -34,15 +34,7 @@
#include <stdlib.h>
#include <vector>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
void test_system_max ()
{

View File

@ -34,15 +34,7 @@ typedef int raw_socket;
#include <stdlib.h>
#include <string.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
// Read one event off the monitor socket; return value and address
// by reference, if not null, and event number by value. Returns -1

View File

@ -35,15 +35,7 @@
#include <stdlib.h>
#include <string.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
void test_monitor_invalid_protocol_fails ()
{

View File

@ -32,15 +32,7 @@
#include <string.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
void ffn (void *data_, void *hint_)
{

View File

@ -30,15 +30,7 @@
#include "testutil.hpp"
#include "testutil_unity.hpp"
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
void test_more ()
{

View File

@ -30,17 +30,7 @@
#include "testutil.hpp"
#include "testutil_unity.hpp"
#include <unity.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
void test_roundtrip ()
{

View File

@ -32,16 +32,7 @@
#include <string.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
typedef void (*extra_func_t) (void *socket_);

View File

@ -30,15 +30,7 @@
#include "testutil.hpp"
#include "testutil_unity.hpp"
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
typedef void (*extra_func_t) (void *socket_);

View File

@ -31,17 +31,7 @@
#include "testutil.hpp"
#include "testutil_unity.hpp"
#include <unity.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
void test_roundtrip ()
{

View File

@ -34,15 +34,7 @@
#include "testutil.hpp"
#include "testutil_unity.hpp"
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
void test_pair_vmci ()
{

View File

@ -30,7 +30,6 @@
#include "testutil.hpp"
#include "testutil_unity.hpp"
#include <unity.h>
#include <limits.h>
#ifndef _WIN32
@ -40,15 +39,7 @@
#include <unistd.h>
#endif
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
fd_t get_fd (void *socket_)
{

View File

@ -30,15 +30,7 @@
#include "testutil.hpp"
#include "testutil_unity.hpp"
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
void test_probe_router_router ()
{

View File

@ -33,15 +33,7 @@
#include <stdlib.h>
#include <string.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
#define CONTENT_SIZE 13
#define CONTENT_SIZE_MAX 32

View File

@ -32,15 +32,7 @@
#include <stdlib.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
// This is our server task.
// It runs a proxy with a single REP socket as both frontend and backend.

View File

@ -32,15 +32,7 @@
#include <stdlib.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
// This is a test for issue #1382. The server thread creates a SUB-PUSH
// steerable proxy. The main process then sends messages to the SUB

View File

@ -32,15 +32,7 @@
#include <string.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
void test ()
{

View File

@ -30,8 +30,6 @@
#include "testutil.hpp"
#include "testutil_unity.hpp"
#include <unity.h>
#include <string.h>
#ifndef _WIN32
@ -53,15 +51,7 @@
_test (true); \
}
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
void msg_send_expect_success (void *s_, const char *group_, const char *body_)
{

View File

@ -30,17 +30,7 @@
#include "testutil.hpp"
#include "testutil_unity.hpp"
#include <unity.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
void test_rebind_ipc ()
{

View File

@ -30,17 +30,7 @@
#include "testutil.hpp"
#include "testutil_unity.hpp"
#include <unity.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
void test_reconnect_ivl_against_pair_socket (const char *my_endpoint_,
void *sb_)

View File

@ -30,15 +30,7 @@
#include "testutil.hpp"
#include "testutil_unity.hpp"
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
void test_req_correlate ()
{

View File

@ -30,17 +30,7 @@
#include "testutil.hpp"
#include "testutil_unity.hpp"
#include <unity.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
void test_roundtrip ()
{

View File

@ -30,17 +30,7 @@
#include "testutil.hpp"
#include "testutil_unity.hpp"
#include <unity.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
// TODO this is heavily duplicated with test_reqrep_device.cpp
void test_roundtrip ()

View File

@ -30,17 +30,7 @@
#include "testutil.hpp"
#include "testutil_unity.hpp"
#include <unity.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
void test_roundtrip ()
{

View File

@ -31,17 +31,8 @@
#include "testutil_unity.hpp"
#include <stdlib.h>
#include <unity.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
void test_leak ()
{

View File

@ -32,15 +32,7 @@
#include <string.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
void test_single_connect (int ipv6_)
{

View File

@ -30,17 +30,7 @@
#include "testutil.hpp"
#include "testutil_unity.hpp"
#include <unity.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
void test_roundtrip ()
{

View File

@ -34,15 +34,7 @@
#include "testutil.hpp"
#include "testutil_unity.hpp"
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
void test_reqrep_vmci ()
{

View File

@ -28,20 +28,9 @@
*/
#include "testutil.hpp"
#include "testutil_unity.hpp"
#include <unity.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
void test_with_handover ()
{

View File

@ -31,17 +31,8 @@
#include "testutil_unity.hpp"
#include <string.h>
#include <unity.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
#ifdef ZMQ_BUILD_DRAFT_API
bool send_msg_to_peer_if_ready (void *router_, const char *peer_routing_id_)

View File

@ -30,15 +30,7 @@
#include "testutil.hpp"
#include "testutil_unity.hpp"
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
// DEBUG shouldn't be defined in sources as it will cause a redefined symbol
// error when it is defined in the build configuration. It appears that the

View File

@ -32,15 +32,7 @@
#include "testutil_unity.hpp"
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
void test_router_mandatory_tipc ()
{

View File

@ -31,17 +31,8 @@
#include "testutil_unity.hpp"
#include <string.h>
#include <unity.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
void test_sockopt_router_notify ()
{

View File

@ -30,17 +30,7 @@
#include "testutil.hpp"
#include "testutil_unity.hpp"
#include <unity.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
void test_scatter_gather_multipart_fails ()
{

View File

@ -30,15 +30,7 @@
#include "testutil.hpp"
#include "testutil_unity.hpp"
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
void test_no_zap_handler ()
{

View File

@ -30,15 +30,7 @@
#include "testutil_security.hpp"
#include "testutil_unity.hpp"
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
static void zap_handler_wrong_version (void * /*unused_*/)
{

View File

@ -32,15 +32,7 @@
#include <string.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
void test_setsockopt_tcp_recv_buffer ()
{

View File

@ -30,17 +30,7 @@
#include "testutil.hpp"
#include "testutil_unity.hpp"
#include <unity.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
const int MAX_SENDS = 10000;

View File

@ -30,16 +30,7 @@
#include "testutil.hpp"
#include "testutil_unity.hpp"
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
// SHALL route outgoing messages to available peers using a round-robin
// strategy.

View File

@ -33,15 +33,7 @@
#include <stdlib.h>
#include <string.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
char connect_address[MAX_SOCKET_STRING];

View File

@ -31,17 +31,8 @@
#include "testutil_unity.hpp"
#include <stdlib.h>
#include <unity.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
char connect_address[MAX_SOCKET_STRING];

View File

@ -30,17 +30,7 @@
#include "testutil.hpp"
#include "testutil_unity.hpp"
#include <unity.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
char connect_address[MAX_SOCKET_STRING];

View File

@ -32,18 +32,8 @@
#include <stdlib.h>
#include <string.h>
#include <unity.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
// SHALL receive incoming messages from its peers using a fair-queuing
// strategy.

View File

@ -31,17 +31,8 @@
#include "testutil_unity.hpp"
#include <string.h>
#include <unity.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
#define MSG_SIZE 20

View File

@ -32,15 +32,7 @@
#include <string.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
// ZMTP protocol greeting structure

View File

@ -32,15 +32,7 @@
#include <string.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
static const int SERVER = 0;
static const int CLIENT = 1;

View File

@ -30,15 +30,7 @@
#include "testutil.hpp"
#include "testutil_unity.hpp"
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
void test_stream_empty ()
{

View File

@ -38,15 +38,7 @@
#include <unistd.h>
#endif
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
void test_stream_exceeds_buffer ()
{

View File

@ -33,15 +33,7 @@
#include <stdlib.h>
#include <string.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
// Read one event off the monitor socket; return value and address
// by reference, if not null, and event number by value. Returns -1

View File

@ -30,17 +30,7 @@
#include "testutil.hpp"
#include "testutil_unity.hpp"
#include <unity.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
void test ()
{

View File

@ -30,17 +30,7 @@
#include "testutil.hpp"
#include "testutil_unity.hpp"
#include <unity.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
void test ()
{

View File

@ -39,15 +39,7 @@
#include <unistd.h>
#endif
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
// Solaris has a default of 256 max files per process
#ifdef ZMQ_HAVE_SOLARIS

View File

@ -30,15 +30,7 @@
#include "testutil.hpp"
#include "testutil_unity.hpp"
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
/* Use the worst case filename size for the buffer (+1 for trailing NUL), this
* is larger than MAX_SOCKET_STRING, which is not large enough for IPC */

View File

@ -30,15 +30,7 @@
#include "testutil.hpp"
#include "testutil_unity.hpp"
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
const char ep[] = "tipc://{5560,0,0}";
const char name[] = "tipc://{5560,0}@0.0.0";

View File

@ -30,17 +30,7 @@
#include "testutil.hpp"
#include "testutil_unity.hpp"
#include <unity.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
// Client threads loop on send/recv until told to exit
void client_thread (void *client_)

View File

@ -30,17 +30,7 @@
#include "testutil.hpp"
#include "testutil_unity.hpp"
#include <unity.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
void test_timeo ()
{

View File

@ -22,15 +22,7 @@
#include <string.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
void test_address_wildcard_ipv4 ()
{

View File

@ -32,19 +32,9 @@
#include <stdlib.h>
#include <string.h>
#include <unity.h>
#include <unistd.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
#if !defined(ZMQ_HAVE_WINDOWS)
#include <sys/socket.h>

View File

@ -30,15 +30,7 @@
#include "testutil.hpp"
#include "testutil_unity.hpp"
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
void test_basic ()
{

View File

@ -30,15 +30,7 @@
#include "testutil.hpp"
#include "testutil_unity.hpp"
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
void test ()
{

View File

@ -30,15 +30,7 @@
#include "testutil.hpp"
#include "testutil_unity.hpp"
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
const uint8_t unsubscribe_a_msg[] = {0, 'A'};
const uint8_t subscribe_a_msg[] = {1, 'A'};

View File

@ -30,17 +30,7 @@
#include "testutil.hpp"
#include "testutil_unity.hpp"
#include <unity.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
void test ()
{

View File

@ -32,21 +32,12 @@
#include <netdb.h>
#include <string.h>
#include <unity.h>
#ifndef _WIN32
#include <unistd.h>
#endif
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
void test_poll_fd ()
{

View File

@ -181,6 +181,12 @@ void recv_array_expect_success (void *socket_,
// for each test case, and some consistency checks can be performed.
/////////////////////////////////////////////////////////////////////////////
// Use this is an test executable to perform a default setup and teardown of
// the test context, which is appropriate for many libzmq test cases.
#define SETUP_TEARDOWN_TESTCONTEXT \
void setUp () { setup_test_context (); } \
void tearDown () { teardown_test_context (); }
// The maximum number of sockets that can be managed by the test context.
#define MAX_TEST_SOCKETS 128