Go to the source code of this file.
|
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "Asterisk External Application Protocol Transaction 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, .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .requires = "res_aeap", } |
|
static const struct ast_module_info * | ast_module_info = &__mod_info |
|
◆ AEAP_TRANSACTION_ID
#define AEAP_TRANSACTION_ID "foo" |
◆ CATEGORY
#define CATEGORY "/res/aeap/transaction/" |
◆ __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 |
( |
transaction_exec |
| ) |
|
◆ AST_TEST_DEFINE() [2/2]
AST_TEST_DEFINE |
( |
transaction_exec_timeout |
| ) |
|
◆ end_transaction()
static void * end_transaction |
( |
void * |
data | ) |
|
|
static |
Definition at line 49 of file test_aeap_transaction.c.
50{
51
52 struct timespec delay = { 1, 0 };
54
55 while (nanosleep(&delay, &delay));
56
57 ++*passed;
59
61}
void * aeap_transaction_user_obj(struct aeap_transaction *tsx)
Retrieve the user object associated with the transaction.
void aeap_transaction_end(struct aeap_transaction *tsx, int result)
End a transaction, and remove it from the given container.
References aeap_transaction_end(), aeap_transaction_user_obj(), and NULL.
Referenced by exec().
◆ exec()
Definition at line 63 of file test_aeap_transaction.c.
65{
70 int passed = 0;
71
73 if (!tsxs) {
75 goto exec_cleanup;
76 }
77
80
82 if (!tsx) {
84 goto exec_cleanup;
85 }
86
90 goto exec_cleanup;
91 }
92
95 goto exec_cleanup;
96 }
97
98 if (passed == 1) {
100 }
101
102exec_cleanup:
103
105 pthread_cancel(thread_id);
106 pthread_join(thread_id,
NULL);
107 }
108
111
112 return res;
113}
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
#define ao2_bump(obj)
Bump refcount on an AO2 object by one, returning the object.
#define AST_PTHREADT_NULL
struct ast_aeap_tsx_params params
#define ast_test_status_update(a, b, c...)
static void * end_transaction(void *data)
#define AEAP_TRANSACTION_ID
struct ao2_container * aeap_transactions_create(void)
Create an Asterisk external application transactions container.
struct aeap_transaction * aeap_transaction_create_and_add(struct ao2_container *transactions, const char *id, struct ast_aeap_tsx_params *params, struct ast_aeap *aeap)
Create a transaction object, and add it to the given container.
int aeap_transaction_start(struct aeap_transaction *tsx)
Start the transaction.
#define ast_pthread_create(a, b, c, d)
References aeap_transaction_create_and_add(), aeap_transaction_end(), AEAP_TRANSACTION_ID, aeap_transaction_start(), aeap_transactions_create(), ao2_bump, ao2_cleanup, ao2_ref, ast_pthread_create, AST_PTHREADT_NULL, AST_TEST_FAIL, AST_TEST_PASS, ast_test_status_update, end_transaction(), NULL, ast_aeap_tsx_params::obj, aeap_transaction::params, and ast_aeap_tsx_params::wait.
Referenced by AST_TEST_DEFINE().
◆ handle_timeout()
◆ 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_DEFAULT , .description = "Asterisk External Application Protocol Transaction 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, .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .requires = "res_aeap", } |
|
static |
◆ ast_module_info