syslog-ng source
test_matcher.c File Reference
#include <criterion/criterion.h>
#include "libtest/msg_parse_lib.h"
#include "libtest/cr_template.h"
#include "logmatcher.h"
#include "apphook.h"
#include "plugin.h"
#include "cfg.h"
#include "scratch-buffers.h"
#include <stdlib.h>
#include <string.h>
Include dependency graph for test_matcher.c:

Functions

void testcase_match (const gchar *log, const gchar *pattern, gboolean expected_result, LogMatcher *m)
 
void testcase_replace (const gchar *log, const gchar *re, gchar *replacement, const gchar *expected_result, LogMatcher *m)
 
void setup (void)
 
void teardown (void)
 
 TestSuite (matcher,.init=setup,.fini=teardown)
 
 Test (matcher, pcre_regexp,.description="PCRE regexp")
 
 Test (matcher, back_ref)
 
 Test (matcher, empty_global,.description="empty match with global flag")
 
 Test (matcher, disable_jit)
 
 Test (matcher, string_match)
 
 Test (matcher, glob_match)
 
 Test (matcher, iso88592_never,.description="match in iso-8859-2 never matches")
 
 Test (matcher, replace)
 
 Test (matcher, pcre812_incompatibility,.description="tests a pcre 8.12 incompatibility")
 
 Test (matcher, test_matcher_sets_num_matches_upon_successful_matching)
 
 Test (matcher, test_matcher_captures_into_indirect_values)
 
 Test (matcher, test_matcher_builtins_are_captured_into_direct_values)
 
 Test (matcher, test_matcher_matches_against_macros_are_captured_directly)
 
 Test (matcher, test_matcher_matches_against_matches_are_captured_directly)
 
 Test (matcher, test_matcher_matches_against_buffers_are_captured_directly)
 
 Test (matcher, test_matcher_matches_are_captured_directly_if_source_handle_changes)
 
 Test (matcher, test_replace_works_correctly_if_capture_group_overwrites_the_input_in_a_match_variable)
 
 Test (matcher, test_replace_works_correctly_if_named_capture_group_overwrites_the_input)
 
 Test (matcher, test_replace_works_correctly_if_input_is_a_match_value_that_gets_truncated)
 

Function Documentation

◆ setup()

void setup ( void  )

◆ teardown()

void teardown ( void  )

◆ Test() [1/19]

Test ( matcher  ,
back_ref   
)

◆ Test() [2/19]

Test ( matcher  ,
disable_jit   
)

◆ Test() [3/19]

Test ( matcher  ,
empty_global  ,
description = "empty match with global flag" 
)

◆ Test() [4/19]

Test ( matcher  ,
glob_match   
)

◆ Test() [5/19]

Test ( matcher  ,
iso88592_never  ,
description = "match in iso-8859-2 never matches" 
)

◆ Test() [6/19]

Test ( matcher  ,
pcre812_incompatibility  ,
description = "tests a pcre 8.12 incompatibility" 
)

◆ Test() [7/19]

Test ( matcher  ,
pcre_regexp  ,
description = "PCRE regexp" 
)

◆ Test() [8/19]

Test ( matcher  ,
replace   
)

◆ Test() [9/19]

Test ( matcher  ,
string_match   
)

◆ Test() [10/19]

Test ( matcher  ,
test_matcher_builtins_are_captured_into_direct_values   
)

◆ Test() [11/19]

Test ( matcher  ,
test_matcher_captures_into_indirect_values   
)

◆ Test() [12/19]

Test ( matcher  ,
test_matcher_matches_against_buffers_are_captured_directly   
)

◆ Test() [13/19]

Test ( matcher  ,
test_matcher_matches_against_macros_are_captured_directly   
)

◆ Test() [14/19]

Test ( matcher  ,
test_matcher_matches_against_matches_are_captured_directly   
)

◆ Test() [15/19]

Test ( matcher  ,
test_matcher_matches_are_captured_directly_if_source_handle_changes   
)

◆ Test() [16/19]

Test ( matcher  ,
test_matcher_sets_num_matches_upon_successful_matching   
)

◆ Test() [17/19]

Test ( matcher  ,
test_replace_works_correctly_if_capture_group_overwrites_the_input_in_a_match_variable   
)

◆ Test() [18/19]

Test ( matcher  ,
test_replace_works_correctly_if_input_is_a_match_value_that_gets_truncated   
)

◆ Test() [19/19]

Test ( matcher  ,
test_replace_works_correctly_if_named_capture_group_overwrites_the_input   
)

◆ testcase_match()

void testcase_match ( const gchar *  log,
const gchar *  pattern,
gboolean  expected_result,
LogMatcher *  m 
)

◆ testcase_replace()

void testcase_replace ( const gchar *  log,
const gchar *  re,
gchar *  replacement,
const gchar *  expected_result,
LogMatcher *  m 
)

◆ TestSuite()

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