|
OpenVPN
|
#include <setjmp.h>#include <stdio.h>#include <stdlib.h>#include <cmocka.h>

Go to the source code of this file.
Macros | |
| #define | HAVE_OLD_CMOCKA_API 1 |
| #define | LargestIntegralType uintmax_t |
| #define | CMockaValueData LargestIntegralType |
| #define | check_expected_uint check_expected |
| #define | expect_uint_value expect_value |
| #define | expect_check_data expect_check |
| #define | cast_ptr_to_cmocka_value(x) (x) |
Functions | |
| static void | openvpn_unit_test_setup (void) |
| Sets up the environment for unit tests like making both stderr and stdout non-buffered to avoid messages getting lost if the program exits early. | |
| void | openvpn_test_get_srcdir_dir (char *buf, size_t bufsize, const char *filename) |
| Helper function to get a file path from the unit test directory to open it or pass its path to another function. | |
| #define cast_ptr_to_cmocka_value | ( | x | ) | (x) |
Definition at line 50 of file test_common.h.
| #define check_expected_uint check_expected |
Definition at line 47 of file test_common.h.
| #define CMockaValueData LargestIntegralType |
Definition at line 46 of file test_common.h.
| #define expect_check_data expect_check |
Definition at line 49 of file test_common.h.
| #define expect_uint_value expect_value |
Definition at line 48 of file test_common.h.
| #define HAVE_OLD_CMOCKA_API 1 |
Definition at line 34 of file test_common.h.
| #define LargestIntegralType uintmax_t |
Definition at line 43 of file test_common.h.
| void openvpn_test_get_srcdir_dir | ( | char * | buf, |
| size_t | bufsize, | ||
| const char * | filename | ||
| ) |
Helper function to get a file path from the unit test directory to open it or pass its path to another function.
This function will first look for an environment variable or if failing that, will fall back to a hardcoded value from compile time if compiled with CMake.
| buf | buffer holding the path to the file |
| bufsize | size of buf |
| filename | name of the filename to retrieve relative to the unit test source directory |
Definition at line 82 of file test_common.h.
Referenced by test_get_user_pass_authfile_file(), test_get_user_pass_authfile_file_assertions(), and test_list().
|
inlinestatic |
Sets up the environment for unit tests like making both stderr and stdout non-buffered to avoid messages getting lost if the program exits early.
This has a openvpn prefix to avoid confusion with cmocka's unit_test_setup_* methods
Definition at line 61 of file test_common.h.
References mbedtls_compat_psa_crypto_init().