OpenVPN
Data Structures | Functions | Variables
test_misc.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 "ssl_util.h"
#include "options_util.h"
#include "test_common.h"
#include "list.h"
Include dependency graph for test_misc.c:

Go to the source code of this file.

Data Structures

struct  word
 

Functions

static void test_compat_lzo_string (void **state)
 
static void test_auth_fail_temp_no_flags (void **state)
 
static void test_auth_fail_temp_flags (void **state)
 
static void test_auth_fail_temp_flags_msg (void **state)
 
static uint32_t word_hash_function (const void *key, uint32_t iv)
 
static bool word_compare_function (const void *key1, const void *key2)
 
static unsigned long get_random (void)
 
static struct hash_elementhash_lookup_by_value (struct hash *hash, void *value)
 
static void test_list (void **state)
 
int main (void)
 

Variables

const struct CMUnitTest misc_tests []
 

Function Documentation

◆ get_random()

static unsigned long get_random ( void  )
static

Definition at line 136 of file test_misc.c.

Referenced by test_list().

◆ hash_lookup_by_value()

static struct hash_element* hash_lookup_by_value ( struct hash hash,
void *  value 
)
static

Definition at line 143 of file test_misc.c.

References hash_iterator_free(), hash_iterator_init(), hash_iterator_next(), and hash_element::value.

Referenced by test_list().

◆ main()

int main ( void  )

Definition at line 324 of file test_misc.c.

References misc_tests, and openvpn_unit_test_setup().

◆ test_auth_fail_temp_flags()

static void test_auth_fail_temp_flags ( void **  state)
static

◆ test_auth_fail_temp_flags_msg()

static void test_auth_fail_temp_flags_msg ( void **  state)
static

Definition at line 101 of file test_misc.c.

References msg, parse_auth_failed_temp(), and options::server_backoff_time.

◆ test_auth_fail_temp_no_flags()

static void test_auth_fail_temp_no_flags ( void **  state)
static

Definition at line 77 of file test_misc.c.

References msg, and parse_auth_failed_temp().

◆ test_compat_lzo_string()

static void test_compat_lzo_string ( void **  state)
static

Definition at line 43 of file test_misc.c.

References gc_free(), gc_new(), and options_string_compat_lzo().

◆ test_list()

static void test_list ( void **  state)
static

◆ word_compare_function()

static bool word_compare_function ( const void *  key1,
const void *  key2 
)
static

Definition at line 130 of file test_misc.c.

References key1.

Referenced by test_list().

◆ word_hash_function()

static uint32_t word_hash_function ( const void *  key,
uint32_t  iv 
)
static

Definition at line 122 of file test_misc.c.

References hash_func().

Referenced by test_list().

Variable Documentation

◆ misc_tests

const struct CMUnitTest misc_tests[]
Initial value:
= {
cmocka_unit_test(test_compat_lzo_string),
cmocka_unit_test(test_auth_fail_temp_no_flags),
cmocka_unit_test(test_auth_fail_temp_flags),
cmocka_unit_test(test_auth_fail_temp_flags_msg),
cmocka_unit_test(test_list)
}

Definition at line 315 of file test_misc.c.

Referenced by main().

test_auth_fail_temp_flags
static void test_auth_fail_temp_flags(void **state)
Definition: test_misc.c:88
test_list
static void test_list(void **state)
Definition: test_misc.c:162
test_auth_fail_temp_flags_msg
static void test_auth_fail_temp_flags_msg(void **state)
Definition: test_misc.c:101
test_compat_lzo_string
static void test_compat_lzo_string(void **state)
Definition: test_misc.c:43
test_auth_fail_temp_no_flags
static void test_auth_fail_temp_no_flags(void **state)
Definition: test_misc.c:77