libzmq  master
ZeroMQ C++ Core Engine (LIBZMQ)
testutil.hpp File Reference
#include "../src/platform.hpp"
#include "../include/zmq.h"
#include "../src/stdint.hpp"
#include <time.h>
#include <assert.h>
#include <stdarg.h>
#include <string>
#include <string.h>
#include <pthread.h>
#include <unistd.h>
#include <signal.h>
#include <stdlib.h>
#include <sys/wait.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
Include dependency graph for testutil.hpp:

Go to the source code of this file.

Macros

#define SETTLE_TIME   300
 
#define streq(s1, s2)    (!strcmp ((s1), (s2)))
 
#define strneq(s1, s2)    (strcmp ((s1), (s2)))
 

Functions

void bounce (void *server, void *client)
 
void close_zero_linger (void *socket)
 
void expect_bounce_fail (void *server, void *client)
 
int is_ipv6_available (void)
 
void msleep (int milliseconds)
 
char * s_recv (void *socket)
 
void s_recv_seq (void *socket,...)
 
int s_send (void *socket, const char *string)
 
void s_send_seq (void *socket,...)
 
int s_sendmore (void *socket, const char *string)
 
void setup_test_environment (void)
 

Variables

const char * SEQ_END = (const char *) 1
 

Macro Definition Documentation

#define streq (   s1,
  s2 
)    (!strcmp ((s1), (s2)))

Definition at line 195 of file testutil.hpp.

Referenced by main(), test_stream_to_dealer(), and zap_handler().

#define strneq (   s1,
  s2 
)    (strcmp ((s1), (s2)))

Definition at line 196 of file testutil.hpp.

Function Documentation

void bounce ( void *  server,
void *  client 
)

Definition at line 73 of file testutil.hpp.

References zmq_getsockopt(), ZMQ_RCVMORE, zmq_recv(), zmq_send(), and ZMQ_SNDMORE.

Referenced by main(), run_test(), test_pair(), and test_req_rep().

Here is the call graph for this function:

Here is the caller graph for this function:

void close_zero_linger ( void *  socket)
void expect_bounce_fail ( void *  server,
void *  client 
)

Definition at line 128 of file testutil.hpp.

References zmq_errno(), ZMQ_RCVTIMEO, zmq_recv(), zmq_send(), zmq_setsockopt(), ZMQ_SNDMORE, and ZMQ_SNDTIMEO.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

int is_ipv6_available ( void  )

Definition at line 328 of file testutil.hpp.

References bind.

Referenced by main().

Here is the caller graph for this function:

char* s_recv ( void *  socket)

Definition at line 170 of file testutil.hpp.

References size, and zmq_recv().

Referenced by main(), and zap_handler().

Here is the call graph for this function:

Here is the caller graph for this function:

void s_recv_seq ( void *  socket,
  ... 
)
int s_send ( void *  socket,
const char *  string 
)

Definition at line 183 of file testutil.hpp.

References size, and zmq_send().

Referenced by main(), and zap_handler().

Here is the call graph for this function:

Here is the caller graph for this function:

void s_send_seq ( void *  socket,
  ... 
)

Definition at line 205 of file testutil.hpp.

References SEQ_END, zmq_send(), and ZMQ_SNDMORE.

Referenced by main(), test_destroy_queue_on_disconnect(), test_envelope(), test_fair_queue_in(), test_pull_fair_queue_in(), test_push_round_robin_out(), test_req_message_format(), test_req_only_listens_to_current_peer(), and test_round_robin_out().

Here is the call graph for this function:

Here is the caller graph for this function:

int s_sendmore ( void *  socket,
const char *  string 
)

Definition at line 190 of file testutil.hpp.

References size, zmq_send(), and ZMQ_SNDMORE.

Referenced by main(), and zap_handler().

Here is the call graph for this function:

Here is the caller graph for this function:

void setup_test_environment ( void  )

Definition at line 285 of file testutil.hpp.

Referenced by main().

Here is the caller graph for this function:

Variable Documentation