Macros | Typedefs | Functions | Variables
test_heartbeats.cpp File Reference
#include "testutil.hpp"
#include <arpa/inet.h>
#include <unistd.h>
#include <limits.h>
#include <stdlib.h>
#include <string.h>
#include "testutil_unity.hpp"
Include dependency graph for test_heartbeats.cpp:

Go to the source code of this file.

Macros

#define DEFINE_TESTS(first, second, first_define, second_define)
 
#define UINT16_MAX   65535
 

Typedefs

typedef int raw_socket
 

Functions

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 ()
 

Variables

const int deciseconds_per_millisecond = 100
 
const int heartbeat_ttl_max
 

Macro Definition Documentation

◆ 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

#define UINT16_MAX   65535

Definition at line 23 of file test_heartbeats.cpp.

Typedef Documentation

◆ raw_socket

typedef int raw_socket

Definition at line 13 of file test_heartbeats.cpp.

Function Documentation

◆ get_monitor_event()

static SETUP_TEARDOWN_TESTCONTEXT int get_monitor_event ( void monitor_)
static

Definition at line 34 of file test_heartbeats.cpp.

◆ main()

int main ( void  )

Definition at line 387 of file test_heartbeats.cpp.

◆ mock_handshake()

static void mock_handshake ( raw_socket  fd_,
int  mock_ping_ 
)
static

Definition at line 75 of file test_heartbeats.cpp.

◆ 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

Definition at line 154 of file test_heartbeats.cpp.

◆ recv_with_retry()

static void recv_with_retry ( raw_socket  fd_,
char *  buffer_,
int  bytes_ 
)
static

Definition at line 61 of file test_heartbeats.cpp.

◆ setup_curve()

static void setup_curve ( void socket_,
int  is_server_ 
)
static

Definition at line 126 of file test_heartbeats.cpp.

◆ test_heartbeat_notimeout()

static void test_heartbeat_notimeout ( int  is_curve_,
int  client_type_,
int  server_type_ 
)
static

Definition at line 276 of file test_heartbeats.cpp.

◆ test_heartbeat_timeout()

static void test_heartbeat_timeout ( int  server_type_,
int  mock_ping_ 
)
static

Definition at line 198 of file test_heartbeats.cpp.

◆ test_heartbeat_timeout_router()

void test_heartbeat_timeout_router ( )

Definition at line 310 of file test_heartbeats.cpp.

◆ test_heartbeat_timeout_router_mock_ping()

void test_heartbeat_timeout_router_mock_ping ( )

Definition at line 315 of file test_heartbeats.cpp.

◆ test_heartbeat_ttl()

static void test_heartbeat_ttl ( int  client_type_,
int  server_type_ 
)
static

Definition at line 233 of file test_heartbeats.cpp.

◆ test_setsockopt_heartbeat_success()

void test_setsockopt_heartbeat_success ( const int  value_)

Definition at line 349 of file test_heartbeats.cpp.

◆ test_setsockopt_heartbeat_ttl_max()

void test_setsockopt_heartbeat_ttl_max ( )

Definition at line 366 of file test_heartbeats.cpp.

◆ test_setsockopt_heartbeat_ttl_more_than_max_fails()

void test_setsockopt_heartbeat_ttl_more_than_max_fails ( )

Definition at line 371 of file test_heartbeats.cpp.

◆ test_setsockopt_heartbeat_ttl_near_zero()

void test_setsockopt_heartbeat_ttl_near_zero ( )

Definition at line 382 of file test_heartbeats.cpp.

Variable Documentation

◆ deciseconds_per_millisecond

const int deciseconds_per_millisecond = 100

Definition at line 345 of file test_heartbeats.cpp.

◆ heartbeat_ttl_max

const int heartbeat_ttl_max
Initial value:

Definition at line 346 of file test_heartbeats.cpp.

UINT16_MAX
#define UINT16_MAX
Definition: test_heartbeats.cpp:23
gmock_output_test._
_
Definition: gmock_output_test.py:173
first
GLint first
Definition: glcorearb.h:2830
deciseconds_per_millisecond
const int deciseconds_per_millisecond
Definition: test_heartbeats.cpp:345


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