Macros | Typedefs | Functions
testutil_unity.hpp File Reference
#include "../include/zmq.h"
#include "testutil.hpp"
#include <unity.h>
Include dependency graph for testutil_unity.hpp:

Go to the source code of this file.

Macros

#define MAX_TEST_SOCKETS   128
 
#define SETUP_TEARDOWN_TESTCONTEXT
 
#define TEST_ASSERT_FAILURE_ERRNO(error_code, expr)
 
#define TEST_ASSERT_FAILURE_RAW_ERRNO(error_code, expr)
 
#define TEST_ASSERT_SUCCESS_ERRNO(expr)   test_assert_success_message_errno_helper (expr, NULL, #expr, __LINE__)
 
#define TEST_ASSERT_SUCCESS_MESSAGE_ERRNO(expr, msg)   test_assert_success_message_errno_helper (expr, msg, #expr, __LINE__)
 
#define TEST_ASSERT_SUCCESS_RAW_ERRNO(expr)   test_assert_success_message_raw_errno_helper (expr, NULL, #expr, __LINE__)
 
#define TEST_ASSERT_SUCCESS_RAW_ZERO_ERRNO(expr)
 

Typedefs

typedef void(* bind_function_t) (void *socket_, char *my_endpoint_, size_t len_)
 

Functions

void bind_loopback (void *socket_, int ipv6_, char *my_endpoint_, size_t len_)
 
void bind_loopback_ipc (void *socket_, char *my_endpoint_, size_t len_)
 
void bind_loopback_ipv4 (void *socket_, char *my_endpoint_, size_t len_)
 
void bind_loopback_ipv6 (void *socket_, char *my_endpoint_, size_t len_)
 
void bind_loopback_tipc (void *socket_, char *my_endpoint_, size_t len_)
 
voidget_test_context ()
 
template<size_t SIZE>
void recv_array_expect_success (void *socket_, const uint8_t(&array_)[SIZE], int flags_)
 
void recv_string_expect_success (void *socket_, const char *str_, int flags_)
 
template<size_t SIZE>
void send_array_expect_success (void *socket_, const uint8_t(&array_)[SIZE], int flags_)
 
void send_string_expect_success (void *socket_, const char *str_, int flags_)
 
void setup_test_context ()
 
void teardown_test_context ()
 
int test_assert_failure_message_raw_errno_helper (int rc_, int expected_errno_, const char *msg_, const char *expr_, int line)
 
int test_assert_success_message_errno_helper (int rc_, const char *msg_, const char *expr_, int line)
 
int test_assert_success_message_raw_errno_helper (int rc_, const char *msg_, const char *expr_, int line, bool zero_=false)
 
int test_assert_success_message_raw_zero_errno_helper (int rc_, const char *msg_, const char *expr_, int line)
 
void test_bind (void *socket_, const char *bind_address_, char *my_endpoint_, size_t len_)
 
voidtest_context_socket (int type_)
 
voidtest_context_socket_close (void *socket_)
 
voidtest_context_socket_close_zero_linger (void *socket_)
 

Macro Definition Documentation

◆ MAX_TEST_SOCKETS

#define MAX_TEST_SOCKETS   128

Definition at line 183 of file testutil_unity.hpp.

◆ SETUP_TEARDOWN_TESTCONTEXT

#define SETUP_TEARDOWN_TESTCONTEXT
Value:
void setUp () \
{ \
setup_test_context (); \
} \
void tearDown () \
{ \
teardown_test_context (); \
}

Definition at line 172 of file testutil_unity.hpp.

◆ TEST_ASSERT_FAILURE_ERRNO

#define TEST_ASSERT_FAILURE_ERRNO (   error_code,
  expr 
)
Value:
{ \
int _rc = (expr); \
TEST_ASSERT_EQUAL_INT (-1, _rc); \
TEST_ASSERT_EQUAL_INT (error_code, errno); \
}

Definition at line 95 of file testutil_unity.hpp.

◆ TEST_ASSERT_FAILURE_RAW_ERRNO

#define TEST_ASSERT_FAILURE_RAW_ERRNO (   error_code,
  expr 
)
Value:
#expr, __LINE__)

Definition at line 87 of file testutil_unity.hpp.

◆ TEST_ASSERT_SUCCESS_ERRNO

#define TEST_ASSERT_SUCCESS_ERRNO (   expr)    test_assert_success_message_errno_helper (expr, NULL, #expr, __LINE__)

Definition at line 59 of file testutil_unity.hpp.

◆ TEST_ASSERT_SUCCESS_MESSAGE_ERRNO

#define TEST_ASSERT_SUCCESS_MESSAGE_ERRNO (   expr,
  msg 
)    test_assert_success_message_errno_helper (expr, msg, #expr, __LINE__)

Definition at line 48 of file testutil_unity.hpp.

◆ TEST_ASSERT_SUCCESS_RAW_ERRNO

#define TEST_ASSERT_SUCCESS_RAW_ERRNO (   expr)    test_assert_success_message_raw_errno_helper (expr, NULL, #expr, __LINE__)

Definition at line 69 of file testutil_unity.hpp.

◆ TEST_ASSERT_SUCCESS_RAW_ZERO_ERRNO

#define TEST_ASSERT_SUCCESS_RAW_ZERO_ERRNO (   expr)
Value:

Definition at line 79 of file testutil_unity.hpp.

Typedef Documentation

◆ bind_function_t

typedef void(* bind_function_t) (void *socket_, char *my_endpoint_, size_t len_)

Definition at line 236 of file testutil_unity.hpp.

Function Documentation

◆ bind_loopback()

void bind_loopback ( void socket_,
int  ipv6_,
char *  my_endpoint_,
size_t  len_ 
)

Definition at line 233 of file testutil_unity.cpp.

◆ bind_loopback_ipc()

void bind_loopback_ipc ( void socket_,
char *  my_endpoint_,
size_t  len_ 
)

Definition at line 256 of file testutil_unity.cpp.

◆ bind_loopback_ipv4()

void bind_loopback_ipv4 ( void socket_,
char *  my_endpoint_,
size_t  len_ 
)

Definition at line 246 of file testutil_unity.cpp.

◆ bind_loopback_ipv6()

void bind_loopback_ipv6 ( void socket_,
char *  my_endpoint_,
size_t  len_ 
)

Definition at line 251 of file testutil_unity.cpp.

◆ bind_loopback_tipc()

void bind_loopback_tipc ( void socket_,
char *  my_endpoint_,
size_t  len_ 
)

Definition at line 265 of file testutil_unity.cpp.

◆ get_test_context()

void* get_test_context ( )

Definition at line 184 of file testutil_unity.cpp.

◆ recv_array_expect_success()

template<size_t SIZE>
void recv_array_expect_success ( void socket_,
const uint8_t(&)  array_[SIZE],
int  flags_ 
)

Definition at line 148 of file testutil_unity.hpp.

◆ recv_string_expect_success()

void recv_string_expect_success ( void socket_,
const char *  str_,
int  flags_ 
)

Definition at line 101 of file testutil_unity.cpp.

◆ send_array_expect_success()

template<size_t SIZE>
void send_array_expect_success ( void socket_,
const uint8_t(&)  array_[SIZE],
int  flags_ 
)

Definition at line 132 of file testutil_unity.hpp.

◆ send_string_expect_success()

void send_string_expect_success ( void socket_,
const char *  str_,
int  flags_ 
)

Definition at line 94 of file testutil_unity.cpp.

◆ setup_test_context()

void setup_test_context ( )

Definition at line 179 of file testutil_unity.cpp.

◆ teardown_test_context()

void teardown_test_context ( )

Definition at line 189 of file testutil_unity.cpp.

◆ test_assert_failure_message_raw_errno_helper()

int test_assert_failure_message_raw_errno_helper ( int  rc_,
int  expected_errno_,
const char *  msg_,
const char *  expr_,
int  line 
)

Definition at line 62 of file testutil_unity.cpp.

◆ test_assert_success_message_errno_helper()

int test_assert_success_message_errno_helper ( int  rc_,
const char *  msg_,
const char *  expr_,
int  line 
)

Definition at line 13 of file testutil_unity.cpp.

◆ test_assert_success_message_raw_errno_helper()

int test_assert_success_message_raw_errno_helper ( int  rc_,
const char *  msg_,
const char *  expr_,
int  line,
bool  zero_ = false 
)

Definition at line 31 of file testutil_unity.cpp.

◆ test_assert_success_message_raw_zero_errno_helper()

int test_assert_success_message_raw_zero_errno_helper ( int  rc_,
const char *  msg_,
const char *  expr_,
int  line 
)

Definition at line 53 of file testutil_unity.cpp.

◆ test_bind()

void test_bind ( void socket_,
const char *  bind_address_,
char *  my_endpoint_,
size_t  len_ 
)

Definition at line 223 of file testutil_unity.cpp.

◆ test_context_socket()

void* test_context_socket ( int  type_)

Definition at line 200 of file testutil_unity.cpp.

◆ test_context_socket_close()

void* test_context_socket_close ( void socket_)

Definition at line 208 of file testutil_unity.cpp.

◆ test_context_socket_close_zero_linger()

void* test_context_socket_close_zero_linger ( void socket_)

Definition at line 215 of file testutil_unity.cpp.

NULL
NULL
Definition: test_security_zap.cpp:405
errno
int errno
tearDown
void tearDown(void)
Definition: test_ancillaries.cpp:17
test_assert_failure_message_raw_errno_helper
int test_assert_failure_message_raw_errno_helper(int rc_, int expected_errno_, const char *msg_, const char *expr_, int line)
Definition: testutil_unity.cpp:62
test_assert_success_message_raw_zero_errno_helper
int test_assert_success_message_raw_zero_errno_helper(int rc_, const char *msg_, const char *expr_, int line)
Definition: testutil_unity.cpp:53
setUp
void setUp(void)
Definition: test_ancillaries.cpp:13


libaditof
Author(s):
autogenerated on Wed May 21 2025 02:07:04