Asterisk - The Open Source Telephony Project
18.5.0
|
res_pjsip scheduler tests More...
#include "asterisk.h"
#include <pjsip.h>
#include "asterisk/test.h"
#include "asterisk/module.h"
#include "asterisk/taskprocessor.h"
#include "asterisk/res_pjsip.h"
#include "asterisk/utils.h"
Go to the source code of this file.
Data Structures | |
struct | test_data |
Sorcery object created based on backend data. More... | |
Macros | |
#define | CATEGORY "/res/res_pjsip/scheduler/" |
#define | M2U(x) (long int)(x * 1000) |
#define | S2U(x) (long int)(x * 1000 * 1000) |
#define | waitfor(x) |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
AST_TEST_DEFINE (serialized_scheduler) | |
AST_TEST_DEFINE (unserialized_scheduler) | |
AST_TEST_DEFINE (scheduler_cleanup) | |
AST_TEST_DEFINE (scheduler_cancel) | |
AST_TEST_DEFINE (scheduler_policy) | |
static void | data_cleanup (void *data) |
static int | dummy_task (void *data) |
static int | load_module (void) |
static int | scheduler (struct ast_test *test, int serialized) |
static int | task_1 (void *data) |
static void | test_destructor (void *data) |
static int | unload_module (void) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "res_pjsip scheduler test module" , .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_pjsip", } |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static int | destruct_count |
static int | run_count |
res_pjsip scheduler tests
Definition in file test_res_pjsip_scheduler.c.
#define CATEGORY "/res/res_pjsip/scheduler/" |
Definition at line 43 of file test_res_pjsip_scheduler.c.
Referenced by AST_TEST_DEFINE().
#define M2U | ( | x | ) | (long int)(x * 1000) |
Definition at line 61 of file test_res_pjsip_scheduler.c.
Referenced by AST_TEST_DEFINE(), dummy_task(), and task_1().
#define S2U | ( | x | ) | (long int)(x * 1000 * 1000) |
Definition at line 60 of file test_res_pjsip_scheduler.c.
#define waitfor | ( | x | ) |
Definition at line 92 of file test_res_pjsip_scheduler.c.
Referenced by AST_TEST_DEFINE(), and scheduler().
|
static |
Definition at line 431 of file test_res_pjsip_scheduler.c.
|
static |
Definition at line 431 of file test_res_pjsip_scheduler.c.
struct ast_module* AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 431 of file test_res_pjsip_scheduler.c.
AST_TEST_DEFINE | ( | serialized_scheduler | ) |
Definition at line 173 of file test_res_pjsip_scheduler.c.
References AST_TEST_NOT_RUN, CATEGORY, sip_to_pjsip::info(), scheduler(), TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | unserialized_scheduler | ) |
Definition at line 190 of file test_res_pjsip_scheduler.c.
References AST_TEST_NOT_RUN, CATEGORY, sip_to_pjsip::info(), scheduler(), TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | scheduler_cleanup | ) |
Definition at line 225 of file test_res_pjsip_scheduler.c.
References ao2_alloc, ao2_cleanup, ao2_ref, ast_sip_sched_is_task_running(), AST_SIP_SCHED_TASK_DATA_AO2, AST_SIP_SCHED_TASK_DATA_FREE, ast_sip_sched_task_get_next_run(), ast_sip_schedule_task(), AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, CATEGORY, destruct_count, dummy_task(), error(), sip_to_pjsip::info(), test_data::interval, M2U, NULL, RAII_VAR, test_data::sleep, task(), test_destructor(), TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | scheduler_cancel | ) |
Definition at line 276 of file test_res_pjsip_scheduler.c.
References ao2_alloc, ao2_cleanup, ao2_ref, ast_sip_sched_is_task_running_by_name(), ast_sip_sched_task_cancel_by_name(), AST_SIP_SCHED_TASK_DATA_NO_CLEANUP, ast_sip_sched_task_get_next_run(), ast_sip_sched_task_get_next_run_by_name(), ast_sip_schedule_task(), AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, CATEGORY, destruct_count, dummy_task(), sip_to_pjsip::info(), test_data::interval, M2U, NULL, RAII_VAR, run_count, test_data::sleep, task(), test_destructor(), TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | scheduler_policy | ) |
Definition at line 326 of file test_res_pjsip_scheduler.c.
References ao2_alloc, ao2_cleanup, ast_cond_init, ast_mutex_init, ast_mutex_lock, ast_mutex_unlock, ast_sip_sched_task_cancel(), AST_SIP_SCHED_TASK_DATA_NO_CLEANUP, AST_SIP_SCHED_TASK_PERIODIC, ast_sip_schedule_task(), AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, ast_tvdiff_ms(), ast_tvnow(), CATEGORY, data_cleanup(), destruct_count, test_data::done, sip_to_pjsip::info(), test_data::interval, M2U, NULL, RAII_VAR, run_count, task(), task_1(), test_data::test, TEST_EXECUTE, TEST_INIT, and waitfor.
|
static |
Definition at line 85 of file test_res_pjsip_scheduler.c.
References ast_cond_destroy, ast_mutex_destroy, test_data::cond, and test_data::lock.
Referenced by AST_TEST_DEFINE(), and scheduler().
|
static |
Definition at line 210 of file test_res_pjsip_scheduler.c.
References M2U, run_count, and test_data::sleep.
Referenced by AST_TEST_DEFINE().
|
static |
Definition at line 406 of file test_res_pjsip_scheduler.c.
References AST_MODULE_LOAD_SUCCESS, and AST_TEST_REGISTER.
Referenced by unload_module().
|
static |
Definition at line 102 of file test_res_pjsip_scheduler.c.
References ao2_alloc, ao2_cleanup, ast_cond_init, ast_mutex_init, ast_sip_create_serializer(), ast_sip_sched_task_cancel(), AST_SIP_SCHED_TASK_FIXED, ast_sip_sched_task_get_times(), ast_sip_schedule_task(), ast_taskprocessor_unreference(), AST_TEST_PASS, ast_test_status_update, ast_tvdiff_ms(), ast_tvnow(), data_cleanup(), MAX, NULL, RAII_VAR, task_1(), test_data::test, and waitfor.
Referenced by AST_TEST_DEFINE().
|
static |
Definition at line 63 of file test_res_pjsip_scheduler.c.
References ast_cond_signal, ast_mutex_lock, ast_mutex_unlock, ast_sip_thread_is_servant(), ast_tvnow(), test_data::cond, test_data::done, test_data::interval, test_data::is_servant, test_data::lock, M2U, test_data::no_clear_done, test_data::sleep, test_data::task_end, test_data::task_start, and test_data::tid.
Referenced by AST_TEST_DEFINE(), and scheduler().
|
static |
Definition at line 220 of file test_res_pjsip_scheduler.c.
References destruct_count.
Referenced by AST_TEST_DEFINE().
|
static |
Definition at line 416 of file test_res_pjsip_scheduler.c.
References AST_MODFLAG_DEFAULT, AST_MODULE_INFO(), AST_MODULE_SUPPORT_CORE, AST_TEST_UNREGISTER, ASTERISK_GPL_KEY, and load_module().
|
static |
Definition at line 431 of file test_res_pjsip_scheduler.c.
|
static |
Definition at line 431 of file test_res_pjsip_scheduler.c.
|
static |
Definition at line 208 of file test_res_pjsip_scheduler.c.
Referenced by AST_TEST_DEFINE(), and test_destructor().
|
static |
Definition at line 207 of file test_res_pjsip_scheduler.c.
Referenced by AST_TEST_DEFINE(), and dummy_task().