OpenVPN
Functions | Variables
mock_msg.c File Reference
#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <setjmp.h>
#include <stdint.h>
#include <cmocka.h>
#include "errlevel.h"
#include "error.h"
Include dependency graph for mock_msg.c:

Go to the source code of this file.

Functions

void mock_set_debug_level (int level)
 Mock debug level defaults to 0, which gives clean(-ish) test reports. More...
 
int get_debug_level (void)
 
void x_msg_va (const unsigned int flags, const char *format, va_list arglist)
 
void x_msg (const unsigned int flags, const char *format,...)
 
void assert_failed (const char *filename, int line, const char *condition)
 
void out_of_memory (void)
 
bool dont_mute (unsigned int flags)
 Check muting filter. More...
 

Variables

unsigned int x_debug_level = 0
 
bool fatal_error_triggered = false
 

Function Documentation

◆ assert_failed()

void assert_failed ( const char *  filename,
int  line,
const char *  condition 
)

Definition at line 78 of file mock_msg.c.

References M_FATAL, and msg.

◆ dont_mute()

bool dont_mute ( unsigned int  flags)

Check muting filter.

Definition at line 97 of file mock_msg.c.

References DECODE_MUTE_LEVEL, M_INFO, M_NOMUTE, msg, mute_category, mute_count, and mute_cutoff.

Referenced by msg_test().

◆ get_debug_level()

int get_debug_level ( void  )

Definition at line 50 of file mock_msg.c.

References x_debug_level.

◆ mock_set_debug_level()

void mock_set_debug_level ( int  level)

Mock debug level defaults to 0, which gives clean(-ish) test reports.

Call this function from your test driver to increase debug output when you need debug output.

Definition at line 44 of file mock_msg.c.

References x_debug_level.

◆ out_of_memory()

void out_of_memory ( void  )

Definition at line 90 of file mock_msg.c.

References PACKAGE_NAME.

◆ x_msg()

void x_msg ( const unsigned int  flags,
const char *  format,
  ... 
)

Definition at line 69 of file mock_msg.c.

References x_msg_va().

◆ x_msg_va()

void x_msg_va ( const unsigned int  flags,
const char *  format,
va_list  arglist 
)

Variable Documentation

◆ fatal_error_triggered

bool fatal_error_triggered = false

Definition at line 41 of file mock_msg.c.

Referenced by x_msg_va().

◆ x_debug_level

unsigned int x_debug_level = 0

Definition at line 40 of file mock_msg.c.

Referenced by check_debug_level(), get_debug_level(), and mock_set_debug_level().