OpenVPN
Macros | Functions
test_openvpnserv.c File Reference
#include <setjmp.h>
#include <cmocka.h>
#include "test_common.h"
#include <winsock2.h>
#include <windows.h>
#include "interactive.c"
Include dependency graph for test_openvpnserv.c:

Go to the source code of this file.

Macros

#define BUF_SIZE   64
 
#define assert_merge_result(sys_env, usr_env, expected)
 

Functions

BOOL ReportStatusToSCMgr (SERVICE_STATUS_HANDLE svc_handle, SERVICE_STATUS *svc_status)
 
static void test_list_contains_domain (void **state)
 
static void check_convert (PCWSTR search_domains, PCWSTR input, DWORD capacity, LSTATUS expected_err, PCWSTR expected)
 
static void test_convert_itf_dns_domains (void **state)
 
static void test_append_search_list (void **state)
 
static void test_remove_search_list_tokens (void **state)
 
static void test_merge_openvpn_environment (void **state)
 
int wmain (void)
 

Macro Definition Documentation

◆ assert_merge_result

#define assert_merge_result (   sys_env,
  usr_env,
  expected 
)
Value:
do \
{ \
PWSTR env_ = MergeOpenvpnEnvironment(sys_env, usr_env); \
assert_non_null(env_); \
size_t size_ = EnvBlockSize(expected); \
assert_int_equal(EnvBlockSize(env_), size_); \
assert_memory_equal(env_, expected, size_); \
free(env_); \
} while (0)
static PWSTR MergeOpenvpnEnvironment(PCWSTR sys_env, PCWSTR usr_env)
Merge the environment for the openvpn process.
static size_t EnvBlockSize(PCWSTR env)
Return the size of an environment block.

Definition at line 268 of file test_openvpnserv.c.

◆ BUF_SIZE

#define BUF_SIZE   64

Definition at line 100 of file test_openvpnserv.c.

Function Documentation

◆ check_convert()

static void check_convert ( PCWSTR  search_domains,
PCWSTR  input,
DWORD  capacity,
LSTATUS  expected_err,
PCWSTR  expected 
)
static

Definition at line 65 of file test_openvpnserv.c.

References ConvertItfDnsDomains().

Referenced by test_convert_itf_dns_domains().

◆ ReportStatusToSCMgr()

BOOL ReportStatusToSCMgr ( SERVICE_STATUS_HANDLE  svc_handle,
SERVICE_STATUS *  svc_status 
)

Definition at line 38 of file test_openvpnserv.c.

◆ test_append_search_list()

static void test_append_search_list ( void **  state)
static

Definition at line 158 of file test_openvpnserv.c.

References AppendSearchList().

Referenced by wmain().

◆ test_convert_itf_dns_domains()

static void test_convert_itf_dns_domains ( void **  state)
static

Definition at line 102 of file test_openvpnserv.c.

References BUF_SIZE, and check_convert().

Referenced by wmain().

◆ test_list_contains_domain()

static void test_list_contains_domain ( void **  state)
static

Definition at line 44 of file test_openvpnserv.c.

References ListContainsDomain().

Referenced by wmain().

◆ test_merge_openvpn_environment()

static void test_merge_openvpn_environment ( void **  state)
static

Definition at line 280 of file test_openvpnserv.c.

References assert_merge_result.

Referenced by wmain().

◆ test_remove_search_list_tokens()

static void test_remove_search_list_tokens ( void **  state)
static

Definition at line 190 of file test_openvpnserv.c.

References RemoveSearchListTokens().

Referenced by wmain().

◆ wmain()

int wmain ( void  )