#include "testutil.hpp"
#include <arpa/inet.h>
#include <unistd.h>
#include <limits.h>
#include <stdlib.h>
#include <string.h>
#include "testutil_unity.hpp"
Go to the source code of this file.
|
static SETUP_TEARDOWN_TESTCONTEXT int | get_monitor_event (void *monitor_) |
|
int | main (void) |
|
static void | mock_handshake (raw_socket fd_, int mock_ping_) |
|
static void | prep_server_socket (int set_heartbeats_, int is_curve_, void **server_out_, void **mon_out_, char *endpoint_, size_t ep_length_, int socket_type_) |
|
static void | recv_with_retry (raw_socket fd_, char *buffer_, int bytes_) |
|
static void | setup_curve (void *socket_, int is_server_) |
|
static void | test_heartbeat_notimeout (int is_curve_, int client_type_, int server_type_) |
|
static void | test_heartbeat_timeout (int server_type_, int mock_ping_) |
|
void | test_heartbeat_timeout_router () |
|
void | test_heartbeat_timeout_router_mock_ping () |
|
static void | test_heartbeat_ttl (int client_type_, int server_type_) |
|
void | test_setsockopt_heartbeat_success (const int value_) |
|
void | test_setsockopt_heartbeat_ttl_max () |
|
void | test_setsockopt_heartbeat_ttl_more_than_max_fails () |
|
void | test_setsockopt_heartbeat_ttl_near_zero () |
|
◆ DEFINE_TESTS
#define DEFINE_TESTS |
( |
|
first, |
|
|
|
second, |
|
|
|
first_define, |
|
|
|
second_define |
|
) |
| |
Value: void test_heartbeat_ttl_##
first##
_##second () \
{ \
test_heartbeat_ttl (first_define, second_define); \
} \
void test_heartbeat_notimeout_##
first##
_##second () \
{ \
test_heartbeat_notimeout (0, first_define, second_define); \
} \
void test_heartbeat_notimeout_##
first##
_##second##_with_curve () \
{ \
test_heartbeat_notimeout (1, first_define, second_define); \
}
Definition at line 320 of file test_heartbeats.cpp.
◆ UINT16_MAX
◆ raw_socket
◆ get_monitor_event()
◆ main()
◆ mock_handshake()
◆ prep_server_socket()
static void prep_server_socket |
( |
int |
set_heartbeats_, |
|
|
int |
is_curve_, |
|
|
void ** |
server_out_, |
|
|
void ** |
mon_out_, |
|
|
char * |
endpoint_, |
|
|
size_t |
ep_length_, |
|
|
int |
socket_type_ |
|
) |
| |
|
static |
◆ recv_with_retry()
static void recv_with_retry |
( |
raw_socket |
fd_, |
|
|
char * |
buffer_, |
|
|
int |
bytes_ |
|
) |
| |
|
static |
◆ setup_curve()
static void setup_curve |
( |
void * |
socket_, |
|
|
int |
is_server_ |
|
) |
| |
|
static |
◆ test_heartbeat_notimeout()
static void test_heartbeat_notimeout |
( |
int |
is_curve_, |
|
|
int |
client_type_, |
|
|
int |
server_type_ |
|
) |
| |
|
static |
◆ test_heartbeat_timeout()
static void test_heartbeat_timeout |
( |
int |
server_type_, |
|
|
int |
mock_ping_ |
|
) |
| |
|
static |
◆ test_heartbeat_timeout_router()
void test_heartbeat_timeout_router |
( |
| ) |
|
◆ test_heartbeat_timeout_router_mock_ping()
void test_heartbeat_timeout_router_mock_ping |
( |
| ) |
|
◆ test_heartbeat_ttl()
static void test_heartbeat_ttl |
( |
int |
client_type_, |
|
|
int |
server_type_ |
|
) |
| |
|
static |
◆ test_setsockopt_heartbeat_success()
void test_setsockopt_heartbeat_success |
( |
const int |
value_ | ) |
|
◆ test_setsockopt_heartbeat_ttl_max()
void test_setsockopt_heartbeat_ttl_max |
( |
| ) |
|
◆ test_setsockopt_heartbeat_ttl_more_than_max_fails()
void test_setsockopt_heartbeat_ttl_more_than_max_fails |
( |
| ) |
|
◆ test_setsockopt_heartbeat_ttl_near_zero()
void test_setsockopt_heartbeat_ttl_near_zero |
( |
| ) |
|
◆ deciseconds_per_millisecond
const int deciseconds_per_millisecond = 100 |
◆ heartbeat_ttl_max
const int heartbeat_ttl_max |