Tests for the ast_event API.
More...
Go to the source code of this file.
|
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "ast_event API Tests" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = AST_BUILDOPT_SUM, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_DEFAULT, .support_level = AST_MODULE_SUPPORT_CORE, } |
|
static const struct ast_module_info * | ast_module_info = &__mod_info |
|
Tests for the ast_event API.
- Author
- Russell Bryant russe.nosp@m.ll@d.nosp@m.igium.nosp@m..com
- Todo:
- API Calls not yet touched by a test: XXX TODO
Definition in file test_event.c.
◆ __reg_module()
static void __reg_module |
( |
void |
| ) |
|
|
static |
◆ __unreg_module()
static void __unreg_module |
( |
void |
| ) |
|
|
static |
◆ AST_MODULE_SELF_SYM()
◆ AST_TEST_DEFINE()
AST_TEST_DEFINE |
( |
event_new_test |
| ) |
|
Definition at line 96 of file test_event.c.
References ast_event_append_ie_str(), ast_event_append_ie_uint(), AST_EVENT_CUSTOM, ast_event_destroy(), ast_event_get_size(), AST_EVENT_IE_CEL_AMAFLAGS, AST_EVENT_IE_CEL_USEREVENT_NAME, AST_EVENT_IE_END, AST_EVENT_IE_PLTYPE_STR, AST_EVENT_IE_PLTYPE_UINT, ast_event_new(), AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, check_event(), sip_to_pjsip::info(), NULL, str, TEST_EXECUTE, TEST_INIT, and type.
102 static const char str[] =
"SIP/alligatormittens";
103 static const uint32_t uint = 0xb00bface;
107 info->name =
"ast_event_new_test";
108 info->category =
"/main/event/";
109 info->summary =
"Test event creation";
111 "This test exercises the API calls that allow allocation "
static int check_event(struct ast_event *event, struct ast_test *test, enum ast_event_type expected_type, const char *type_name, const char *str, uint32_t uint)
#define ast_test_status_update(a, b, c...)
Channel Event User Event Name Used by: AST_EVENT_CEL Payload type: STR.
int ast_event_append_ie_str(struct ast_event **event, enum ast_event_ie_type ie_type, const char *str)
Append an information element that has a string payload.
Channel Event AMA flags Used by: AST_EVENT_CEL Payload type: UINT.
void ast_event_destroy(struct ast_event *event)
Destroy an event.
struct ast_event * ast_event_new(enum ast_event_type event_type,...)
Create a new event.
size_t ast_event_get_size(const struct ast_event *event)
Get the size of an event.
int ast_event_append_ie_uint(struct ast_event **event, enum ast_event_ie_type ie_type, uint32_t data)
Append an information element that has an integer payload.
◆ check_event()
static int check_event |
( |
struct ast_event * |
event, |
|
|
struct ast_test * |
test, |
|
|
enum ast_event_type |
expected_type, |
|
|
const char * |
type_name, |
|
|
const char * |
str, |
|
|
uint32_t |
uint |
|
) |
| |
|
static |
Definition at line 49 of file test_event.c.
References ast_event_get_ie_str(), ast_event_get_ie_uint(), ast_event_get_type(), AST_EVENT_IE_CEL_AMAFLAGS, AST_EVENT_IE_CEL_CIDNAME, AST_EVENT_IE_CEL_EVENT_TIME_USEC, AST_EVENT_IE_CEL_USEREVENT_NAME, ast_test_status_update, and type.
Referenced by AST_TEST_DEFINE().
Channel Event CID name Used by: AST_EVENT_CEL Payload type: STR.
enum ast_event_type ast_event_get_type(const struct ast_event *event)
Get the type for an event.
Channel Event Time (micro-seconds) Used by: AST_EVENT_CEL Payload type: UINT.
#define ast_test_status_update(a, b, c...)
Channel Event User Event Name Used by: AST_EVENT_CEL Payload type: STR.
Channel Event AMA flags Used by: AST_EVENT_CEL Payload type: UINT.
uint32_t ast_event_get_ie_uint(const struct ast_event *event, enum ast_event_ie_type ie_type)
Get the value of an information element that has an integer payload.
const char * ast_event_get_ie_str(const struct ast_event *event, enum ast_event_ie_type ie_type)
Get the value of an information element that has a string payload.
◆ load_module()
static int load_module |
( |
void |
| ) |
|
|
static |
◆ unload_module()
static int unload_module |
( |
void |
| ) |
|
|
static |
◆ __mod_info
struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "ast_event API Tests" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = AST_BUILDOPT_SUM, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_DEFAULT, .support_level = AST_MODULE_SUPPORT_CORE, } |
|
static |
◆ ast_module_info