| Asterisk - The Open Source Telephony Project GIT-master-27fb039
    | 
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 (scheduler_cancel) | |
| AST_TEST_DEFINE (scheduler_cleanup) | |
| AST_TEST_DEFINE (scheduler_policy) | |
| AST_TEST_DEFINE (serialized_scheduler) | |
| AST_TEST_DEFINE (unserialized_scheduler) | |
| 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 = ASTERISK_GPL_KEY , .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.
| #define M2U | ( | x | ) | (long int)(x * 1000) | 
Definition at line 61 of file test_res_pjsip_scheduler.c.
| #define S2U | ( | x | ) | (long int)(x * 1000 * 1000) | 
Definition at line 60 of file test_res_pjsip_scheduler.c.
| #define waitfor | ( | x | ) | 
| 
 | 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 | ( | 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(), M2U, NULL, RAII_VAR, run_count, task(), test_destructor(), 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(), M2U, NULL, RAII_VAR, 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, done, M2U, NULL, RAII_VAR, run_count, task(), task_1(), TEST_EXECUTE, TEST_INIT, and waitfor.
| AST_TEST_DEFINE | ( | serialized_scheduler | ) | 
Definition at line 173 of file test_res_pjsip_scheduler.c.
References AST_TEST_NOT_RUN, CATEGORY, 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, scheduler(), TEST_EXECUTE, and TEST_INIT.
| 
 | 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(), AST_TEST_DEFINE(), and scheduler().
| 
 | static | 
Definition at line 210 of file test_res_pjsip_scheduler.c.
References M2U, and run_count.
Referenced by AST_TEST_DEFINE(), and AST_TEST_DEFINE().
| 
 | static | 
Definition at line 406 of file test_res_pjsip_scheduler.c.
References AST_MODULE_LOAD_SUCCESS, and AST_TEST_REGISTER.
| 
 | 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(), and waitfor.
Referenced by AST_TEST_DEFINE(), and 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(), and M2U.
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(), and AST_TEST_DEFINE().
| 
 | static | 
Definition at line 416 of file test_res_pjsip_scheduler.c.
References AST_TEST_UNREGISTER.
| 
 | 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(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), and test_destructor().
| 
 | static | 
Definition at line 207 of file test_res_pjsip_scheduler.c.
Referenced by AST_TEST_DEFINE(), AST_TEST_DEFINE(), and dummy_task().