Channel unit tests.
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 = "Channel Unit 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 |
|
Channel unit tests.
- Author
- Joshua Colp jcolp.nosp@m.@dig.nosp@m.ium.c.nosp@m.om
Definition in file test_channel.c.
◆ __reg_module()
static void __reg_module |
( |
void |
| ) |
|
|
static |
◆ __unreg_module()
static void __unreg_module |
( |
void |
| ) |
|
|
static |
◆ AST_MODULE_SELF_SYM()
◆ AST_TEST_DEFINE() [1/2]
AST_TEST_DEFINE |
( |
set_fd_grow |
| ) |
|
Definition at line 38 of file test_channel.c.
References ast_channel_alloc, ast_channel_fd(), ast_channel_fd_count(), ast_channel_set_fd(), AST_EXTENDED_FDS, ast_hangup(), AST_STATE_DOWN, AST_TEST_NOT_RUN, AST_TEST_PASS, done, sip_to_pjsip::info(), NULL, TEST_EXECUTE, and TEST_INIT.
46 info->name =
"set_fd_grow";
47 info->category =
"/main/channel/";
48 info->summary =
"channel setting file descriptor with growth test";
50 "Test that setting a file descriptor on a high position of a channel results in -1 set on any new positions";
56 mock_channel =
ast_channel_alloc(0,
AST_STATE_DOWN,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL, 0,
"TestChannel");
57 ast_test_validate_cleanup(
test, mock_channel, res,
done);
Main Channel structure associated with a channel.
void ast_hangup(struct ast_channel *chan)
Hang up a channel.
void ast_channel_set_fd(struct ast_channel *chan, int which, int fd)
int ast_channel_fd(const struct ast_channel *chan, int which)
int ast_channel_fd_count(const struct ast_channel *chan)
Retrieve the number of file decriptor positions present on the channel.
#define ast_channel_alloc(needqueue, state, cid_num, cid_name, acctcode, exten, context, assignedids, requestor, amaflag,...)
Create a channel structure.
◆ AST_TEST_DEFINE() [2/2]
AST_TEST_DEFINE |
( |
add_fd |
| ) |
|
Definition at line 72 of file test_channel.c.
References ast_channel_alloc, ast_channel_fd(), ast_channel_fd_add(), ast_channel_set_fd(), AST_EXTENDED_FDS, ast_hangup(), AST_STATE_DOWN, AST_TEST_NOT_RUN, AST_TEST_PASS, done, sip_to_pjsip::info(), NULL, TEST_EXECUTE, and TEST_INIT.
80 info->name =
"add_fd";
81 info->category =
"/main/channel/";
82 info->summary =
"channel adding file descriptor test";
84 "Test that adding a file descriptor to a channel places it in the expected position";
90 mock_channel =
ast_channel_alloc(0,
AST_STATE_DOWN,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL, 0,
"TestChannel");
91 ast_test_validate_cleanup(
test, mock_channel, res,
done);
Main Channel structure associated with a channel.
int ast_channel_fd_add(struct ast_channel *chan, int value)
Add a file descriptor to the channel without a fixed position.
void ast_hangup(struct ast_channel *chan)
Hang up a channel.
void ast_channel_set_fd(struct ast_channel *chan, int which, int fd)
int ast_channel_fd(const struct ast_channel *chan, int which)
#define ast_channel_alloc(needqueue, state, cid_num, cid_name, acctcode, exten, context, assignedids, requestor, amaflag,...)
Create a channel structure.
◆ 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 = "Channel Unit 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