48 static void test_scope_trace(
void)
50 SCOPE_ENTER(1,
"subfunction\n");
51 SCOPE_EXIT_RTN(
"got out\n");
54 static int test_scope_enter_function(
void)
56 SCOPE_ENTER(1,
"%s %s %s %s %s %s %s\n",
68 SCOPE_EXIT_RTN_VALUE(AST_TEST_PASS,
"test no variables\n");
74 SCOPE_ENTER(1,
"top %s function\n",
"scope_test");
76 ast_trace(1,
"%s\n",
"test outer");
81 SCOPE_ENTER(1,
"TEST_INIT\n");
82 info->name =
"scope_test";
83 info->category =
"/main/logging/";
84 info->summary =
"Scope Trace Tests";
85 info->description =
"Scope Trace Tests";
87 SCOPE_EXIT(
"TEST_INIT\n");
89 SCOPE_EXIT_RTN_VALUE(AST_TEST_NOT_RUN,
"BYE\n");
93 SCOPE_ENTER(1,
"TEST_EXECUTE\n");
94 ast_trace(1,
"%s\n",
"test execute");
95 SCOPE_EXIT_EXPR(
break,
"TEST_EXECUTE\n");
98 ast_test_status_update(
test,
"Shouldn't have gotten here\n");
103 SCOPE_TRACE(1,
"IF block\n");
104 test_scope_enter_function();
108 ast_trace(1,
"test no variables\n");
109 ast_trace(1,
"%s\n",
"test variable");
111 SCOPE_EXIT_RTN_VALUE(AST_TEST_PASS,
"Something: %d\n", AST_TEST_PASS);
114 static int unload_module(
void)
116 AST_TEST_UNREGISTER(scope_test);
120 static int load_module(
void)
122 AST_TEST_REGISTER(scope_test);
Asterisk main include file. File version handling, generic pbx functions.
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
int ast_str_append(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Append to a thread local dynamic string.
#define ast_str_tmp(init_len, __expr)
Provides a temporary ast_str and returns a copy of its buffer.
Support for dynamic strings.
Support for logging to various files, console and syslog Configuration in file logger.conf.
static const char * str_appender(struct ast_str **buf, char *a)
Function that needs a temporary ast_str.
#define AST_TEST_DEFINE(hdr)
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.