Commit af4fa22f authored by Simon Giesecke's avatar Simon Giesecke

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

Solution: define setUp/tearDown functions via SETUP_TEARDOWN_TESTCONTEXT macro where possible
parent 2b80dd7a
......@@ -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";
......
......@@ -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 ()
{
......
......@@ -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 ()
{
......
......@@ -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_)
{
......
......@@ -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 ()
{
......
......@@ -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 ()
{
......
......@@ -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";
......
......@@ -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)
......
......@@ -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_)
{
......
......@@ -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 ()
{
......
......@@ -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) \
......
......@@ -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_)
{
......
......@@ -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];
......
......@@ -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 ()
{
......
......@@ -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
......
......@@ -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;
......
......@@ -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)
{
......
......@@ -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 ()
{
......
......@@ -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*/)
{
......
......@@ -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 ()
{
......
......@@ -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
......
......@@ -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 ()
{
......
......@@ -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
......
......@@ -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_)
{
......
......@@ -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 ()
{
......
......@@ -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
......
......@@ -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 ()
{
......
......@@ -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_)
{
......
......@@ -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 ()
{
......
......@@ -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 ()
{
......
......@@ -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_);
......
......@@ -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_);
......
......@@ -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 ()
{
......
......@@ -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 ()
{
......
......@@ -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_)
{
......
......@@ -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 ()
{
......
......@@ -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
......
......@@ -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.
......
......@@ -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
......
......@@ -32,15 +32,7 @@
#include <string.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
void test ()
{
......
......@@ -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_)
{
......
......@@ -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 ()
{
......
......@@ -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_)
......
......@@ -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 ()
{
......
......@@ -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 ()
{
......
......@@ -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 ()
......
......@@ -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 ()
{
......
......@@ -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 ()
{
......
......@@ -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_)
{
......
......@@ -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 ()
{
......
......@@ -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 ()
{
......
......@@ -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 ()
{
......
......@@ -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_)
......
......@@ -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
......
......@@ -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 ()
{
......
......@@ -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 ()
{
......
......@@ -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 ()
{
......
......@@ -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 ()
{
......
......@@ -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_*/)
{
......
......@@ -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 ()
{
......
......@@ -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;
......
......@@ -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.
......
......@@ -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];
......
......@@ -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];
......
......@@ -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];
......
......@@ -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.
......
......@@ -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
......
......@@ -32,15 +32,7 @@
#include <string.h>
void setUp ()
{
setup_test_context ();
}
void tearDown ()
{
teardown_test_context ();
}
SETUP_TEARDOWN_TESTCONTEXT
// ZMTP protocol greeting structure
......
......@@ -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;
......
......@@ -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 ()
{
......
......@@ -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 ()
{
......
......@@ -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
......
......@@ -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 ()
{
......
......@@ -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 ()
{
......
......@@ -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
......
......@@ -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 */
......
......@@ -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";
......
......@@ -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_)
......
......@@ -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 ()
{
......
......@@ -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 ()
{
......
......@@ -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>
......
......@@ -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 ()
{
......
......@@ -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 ()
{
......
......@@ -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'};
......
......@@ -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 ()
{
......
......@@ -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 ()
{
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment