OpenVPN
Functions | Variables
test_socket.c File Reference
#include "syshead.h"
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <setjmp.h>
#include <cmocka.h>
#include "socket.h"
#include "win32.h"
Include dependency graph for test_socket.c:

Go to the source code of this file.

Functions

int signal_reset (struct signal_info *si, int signum)
 Clear the signal if its current value equals signum.
 
int win32_signal_get (struct win32_signal *ws)
 
int parse_line (const char *line, char **p, const int n, const char *file, const int line_num, int msglevel, struct gc_arena *gc)
 
static void test_add_in6_addr_tc (const char *orig_str, uint32_t add, const char *expect_str)
 
static bool check_mapped_ipv4_address (void)
 
static void test_add_in6_addr (void **state)
 
int main (void)
 

Variables

struct signal_info siginfo_static
 
struct win32_signal win32_signal
 
const struct CMUnitTest socket_tests []
 

Function Documentation

◆ check_mapped_ipv4_address()

static bool check_mapped_ipv4_address ( void  )
static

Definition at line 83 of file test_socket.c.

References gc, gc_free(), gc_new(), and print_in6_addr().

Referenced by test_add_in6_addr().

◆ main()

int main ( void  )

Definition at line 123 of file test_socket.c.

References socket_tests.

◆ parse_line()

int parse_line ( const char *  line,
char **  p,
const int  n,
const char *  file,
const int  line_num,
int  msglevel,
struct gc_arena gc 
)

Definition at line 61 of file test_socket.c.

◆ signal_reset()

int signal_reset ( struct signal_info si,
int  signum 
)

Clear the signal if its current value equals signum.

If signum is zero the signal is cleared independent of its current value.

Returns
the current value of the signal.

If signum is zero the signal is cleared independent of its current value. Returns the current value of the signal.

Definition at line 43 of file test_socket.c.

◆ test_add_in6_addr()

static void test_add_in6_addr ( void **  state)
static

Definition at line 96 of file test_socket.c.

References check_mapped_ipv4_address(), and test_add_in6_addr_tc().

◆ test_add_in6_addr_tc()

static void test_add_in6_addr_tc ( const char *  orig_str,
uint32_t  add,
const char *  expect_str 
)
static

Definition at line 69 of file test_socket.c.

References add_in6_addr(), gc, gc_free(), gc_new(), and print_in6_addr().

Referenced by test_add_in6_addr().

◆ win32_signal_get()

int win32_signal_get ( struct win32_signal ws)

Definition at line 53 of file test_socket.c.

Variable Documentation

◆ siginfo_static

struct signal_info siginfo_static

Definition at line 40 of file test_socket.c.

◆ socket_tests

const struct CMUnitTest socket_tests[]
Initial value:
= {
cmocka_unit_test(test_add_in6_addr)
}
static void test_add_in6_addr(void **state)
Definition test_socket.c:96

Definition at line 118 of file test_socket.c.

Referenced by main().

◆ win32_signal

Definition at line 50 of file test_socket.c.