28#if defined(ENABLE_CRYPTO_MBEDTLS)
33#ifndef HAVE_CMOCKA_VERSION_H
34#define HAVE_OLD_CMOCKA_API 1
42#ifndef LargestIntegralType
43#define LargestIntegralType uintmax_t
46#define CMockaValueData LargestIntegralType
47#define check_expected_uint check_expected
48#define expect_uint_value expect_value
49#define expect_check_data expect_check
50#define cast_ptr_to_cmocka_value(x) (x)
63 assert_int_equal(setvbuf(stdout, NULL, _IONBF, BUFSIZ), 0);
64 assert_int_equal(setvbuf(stderr, NULL, _IONBF, BUFSIZ), 0);
65#if defined(ENABLE_CRYPTO_MBEDTLS)
84 const char *srcdir = getenv(
"srcdir");
86#if defined(UNIT_TEST_SOURCEDIR)
89 srcdir = UNIT_TEST_SOURCEDIR;
92 assert_non_null(srcdir);
94 snprintf(buf, bufsize,
"%s/%s", srcdir, filename);
mbedtls compatibility stub.
static void mbedtls_compat_psa_crypto_init(void)
static void openvpn_unit_test_setup(void)
Sets up the environment for unit tests like making both stderr and stdout non-buffered to avoid messa...
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 anothe...