syslog-ng source
test_confgen.c File Reference
#include <criterion/criterion.h>
#include "libtest/grab-logging.h"
#include "libtest/mock-cfg-parser.h"
#include "apphook.h"
#include "cfg-grammar.h"
Include dependency graph for test_confgen.c:

Macros

#define TESTDATA_DIR   TOP_SRCDIR "/modules/confgen/tests"
 
#define assert_token_type(expected)    cr_assert_eq(_current_token()->type, expected, "Unexpected token type %d != %d", _current_token()->type, expected);
 
#define assert_parser_string(expected)
 
#define assert_parser_character_token(expected)
 
#define assert_parser_identifier(expected)
 

Functions

 Test (confgen, confgen_script_output_is_included_into_the_config)
 
 Test (confgen, confgen_unknown_context_is_reported_as_an_error)
 
 TestSuite (confgen,.init=setup,.fini=teardown)
 

Variables

CfgParserMock * parser = NULL
 

Macro Definition Documentation

◆ assert_parser_character_token

#define assert_parser_character_token (   expected)
Value:
_next_token(); \
assert_token_type((gint) expected);

◆ assert_parser_identifier

#define assert_parser_identifier (   expected)
Value:
_next_token(); \
assert_token_type(LL_IDENTIFIER); \
cr_assert_str_eq(_current_token()->cptr, expected, "Unexpected identifier parsed >>>%s<<< != >>>%s<<<", _current_token()->cptr, expected);

◆ assert_parser_string

#define assert_parser_string (   expected)
Value:
_next_token(); \
assert_token_type(LL_STRING); \
cr_assert_str_eq(_current_token()->cptr, expected, "Unexpected string value parsed >>>%s<<< != >>>%s<<<", _current_token()->cptr, expected);

◆ assert_token_type

#define assert_token_type (   expected)     cr_assert_eq(_current_token()->type, expected, "Unexpected token type %d != %d", _current_token()->type, expected);

◆ TESTDATA_DIR

#define TESTDATA_DIR   TOP_SRCDIR "/modules/confgen/tests"

Function Documentation

◆ Test() [1/2]

Test ( confgen  ,
confgen_script_output_is_included_into_the_config   
)

◆ Test() [2/2]

Test ( confgen  ,
confgen_unknown_context_is_reported_as_an_error   
)

◆ TestSuite()

TestSuite ( confgen  ,
init = setup,
fini = teardown 
)

Variable Documentation

◆ parser

CfgParserMock* parser = NULL