Branch data Line data Source code
1 : : #include "test_libtestitall_all.h"
2 : :
3 : : /**
4 : : * @file test_libtestitall_common_utils.c
5 : : * @brief Common helper functions shared by multiple libtestitall tests
6 : : */
7 : :
8 : : /**
9 : : * @brief Match the shared STDERR buffer against an inline PCRE2 pattern
10 : : *
11 : : * @param[in] pattern_text Inline PCRE2 pattern expected in STDERR
12 : : * @return Return status code
13 : : */
14 : 2 : Return assert_stderr_matches_pattern(const char *pattern_text)
15 : : {
16 : : /* Status returned by this function through provide()
17 : : Default value assumes successful completion */
18 : 2 : Return status = SUCCESS;
19 : 2 : m_create(char,pattern,MEMORY_STRING);
20 : :
21 [ - + ]: 2 : if(pattern_text == NULL)
22 : : {
23 : 0 : status = FAILURE;
24 : : }
25 : :
26 : 2 : run(m_copy_string(pattern,pattern_text));
27 : 2 : run(match_pattern(STDERR,pattern,"shared STDERR"));
28 : :
29 [ + - ]: 2 : if(SUCCESS == status)
30 : : {
31 : 2 : call(m_del(STDERR));
32 : : }
33 : :
34 : 2 : call(m_del(pattern));
35 : :
36 : 2 : deliver(status);
37 : : }
|