Asterisk - The Open Source Telephony Project GIT-master-a63eec2
|
Unit tests for jitterbuf.c. More...
#include "asterisk.h"
#include "asterisk/utils.h"
#include "asterisk/module.h"
#include "asterisk/test.h"
#include "jitterbuf.h"
Go to the source code of this file.
Macros | |
#define | DEFAULT_CODEC_INTERP_LEN 20 |
#define | DEFAULT_MAX_CONTIG_INTERP 10 |
#define | DEFAULT_MAX_JITTERBUFFER 1000 |
#define | DEFAULT_RESYNCH_THRESHOLD 1000 |
#define | DEFAULT_TARGET_EXTRA -1 |
#define | JB_INFO_PRINT_FRAME_DEBUG(jbinfo) |
#define | JB_NUMERIC_TEST(attribute, expected) |
#define | JB_TEST_BEGIN(test_name) |
#define | JB_TEST_END |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
AST_TEST_DEFINE (jitterbuffer_late_control) | |
AST_TEST_DEFINE (jitterbuffer_late_voice) | |
AST_TEST_DEFINE (jitterbuffer_lost_control) | |
AST_TEST_DEFINE (jitterbuffer_lost_voice) | |
AST_TEST_DEFINE (jitterbuffer_nominal_control_frames) | |
AST_TEST_DEFINE (jitterbuffer_nominal_voice_frames) | |
AST_TEST_DEFINE (jitterbuffer_out_of_order_control) | |
AST_TEST_DEFINE (jitterbuffer_out_of_order_voice) | |
AST_TEST_DEFINE (jitterbuffer_overflow_control) | |
AST_TEST_DEFINE (jitterbuffer_overflow_voice) | |
AST_TEST_DEFINE (jitterbuffer_resynch_control) | |
AST_TEST_DEFINE (jitterbuffer_resynch_voice) | |
static int | load_module (void) |
static void | test_jb_debug_output (const char *fmt,...) |
static void | test_jb_error_output (const char *fmt,...) |
static int | test_jb_late_frame_insertion (struct ast_test *test, struct jitterbuf *jb, enum jb_frame_type frame_type) |
static int | test_jb_lost_frame_insertion (struct ast_test *test, struct jitterbuf *jb, enum jb_frame_type frame_type) |
static int | test_jb_nominal_frame_insertion (struct ast_test *test, struct jitterbuf *jb, enum jb_frame_type frame_type) |
static int | test_jb_out_of_order_frame_insertion (struct ast_test *test, struct jitterbuf *jb, enum jb_frame_type frame_type) |
static void | test_jb_overflow_frame_insertion (struct jitterbuf *jb, enum jb_frame_type frame_type) |
static void | test_jb_populate_config (struct jb_conf *jbconf) |
static void | test_jb_resynch_frame_insertion (struct jitterbuf *jb, enum jb_frame_type frame_type) |
static void | test_jb_warn_output (const char *fmt,...) |
static int | unload_module (void) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Jitter Buffer Tests" , .key = ASTERISK_GPL_KEY , .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 |
static const char * | jitter_buffer_return_codes [] |
Unit tests for jitterbuf.c.
Definition in file test_jitterbuf.c.
#define DEFAULT_CODEC_INTERP_LEN 20 |
Definition at line 44 of file test_jitterbuf.c.
#define DEFAULT_MAX_CONTIG_INTERP 10 |
Definition at line 42 of file test_jitterbuf.c.
#define DEFAULT_MAX_JITTERBUFFER 1000 |
Definition at line 40 of file test_jitterbuf.c.
#define DEFAULT_RESYNCH_THRESHOLD 1000 |
Definition at line 41 of file test_jitterbuf.c.
#define DEFAULT_TARGET_EXTRA -1 |
Definition at line 43 of file test_jitterbuf.c.
#define JB_INFO_PRINT_FRAME_DEBUG | ( | jbinfo | ) |
Definition at line 60 of file test_jitterbuf.c.
#define JB_NUMERIC_TEST | ( | attribute, | |
expected | |||
) |
Definition at line 50 of file test_jitterbuf.c.
#define JB_TEST_BEGIN | ( | test_name | ) |
Definition at line 76 of file test_jitterbuf.c.
#define JB_TEST_END |
Definition at line 84 of file test_jitterbuf.c.
|
static |
Definition at line 1282 of file test_jitterbuf.c.
|
static |
Definition at line 1282 of file test_jitterbuf.c.
struct ast_module * AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 1282 of file test_jitterbuf.c.
AST_TEST_DEFINE | ( | jitterbuffer_late_control | ) |
Definition at line 837 of file test_jitterbuf.c.
References AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, cleanup(), DEFAULT_CODEC_INTERP_LEN, jb_info::frames_dropped, jb_info::frames_in, jb_info::frames_late, jb_info::frames_lost, jb_info::frames_ooo, jb_info::frames_out, jitterbuf::info, jb_destroy(), jb_get(), jb_getall(), jb_getinfo(), JB_INFO_PRINT_FRAME_DEBUG, jb_new(), JB_NUMERIC_TEST, JB_OK, jb_setconf(), JB_TEST_BEGIN, JB_TEST_END, JB_TYPE_CONTROL, jitter_buffer_return_codes, jb_frame::ms, NULL, result, jb_info::resync_offset, TEST_EXECUTE, TEST_INIT, test_jb_late_frame_insertion(), test_jb_populate_config(), and jb_frame::ts.
AST_TEST_DEFINE | ( | jitterbuffer_late_voice | ) |
Definition at line 758 of file test_jitterbuf.c.
References AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, cleanup(), DEFAULT_CODEC_INTERP_LEN, jb_info::frames_dropped, jb_info::frames_in, jb_info::frames_late, jb_info::frames_lost, jb_info::frames_ooo, jb_info::frames_out, jitterbuf::info, jb_destroy(), jb_get(), jb_getall(), jb_getinfo(), JB_INFO_PRINT_FRAME_DEBUG, jb_new(), JB_NUMERIC_TEST, JB_OK, jb_setconf(), JB_TEST_BEGIN, JB_TEST_END, JB_TYPE_VOICE, jitter_buffer_return_codes, jb_frame::ms, NULL, result, jb_info::resync_offset, TEST_EXECUTE, TEST_INIT, test_jb_late_frame_insertion(), test_jb_populate_config(), and jb_frame::ts.
AST_TEST_DEFINE | ( | jitterbuffer_lost_control | ) |
Definition at line 644 of file test_jitterbuf.c.
References AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, cleanup(), DEFAULT_CODEC_INTERP_LEN, jb_info::frames_dropped, jb_info::frames_in, jb_info::frames_late, jb_info::frames_lost, jb_info::frames_ooo, jb_info::frames_out, jitterbuf::info, jb_destroy(), jb_get(), jb_getall(), jb_getinfo(), JB_INFO_PRINT_FRAME_DEBUG, jb_new(), JB_NOFRAME, JB_NUMERIC_TEST, JB_OK, jb_setconf(), JB_TEST_BEGIN, JB_TEST_END, JB_TYPE_CONTROL, jitter_buffer_return_codes, jb_frame::ms, NULL, result, jb_info::resync_offset, TEST_EXECUTE, TEST_INIT, test_jb_lost_frame_insertion(), test_jb_populate_config(), and jb_frame::ts.
AST_TEST_DEFINE | ( | jitterbuffer_lost_voice | ) |
Definition at line 558 of file test_jitterbuf.c.
References AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, cleanup(), DEFAULT_CODEC_INTERP_LEN, jb_info::frames_dropped, jb_info::frames_in, jb_info::frames_late, jb_info::frames_lost, jb_info::frames_ooo, jb_info::frames_out, jitterbuf::info, jb_destroy(), jb_get(), jb_getall(), jb_getinfo(), JB_INFO_PRINT_FRAME_DEBUG, JB_INTERP, jb_new(), JB_NOFRAME, JB_NUMERIC_TEST, JB_OK, jb_setconf(), JB_TEST_BEGIN, JB_TEST_END, JB_TYPE_VOICE, jitter_buffer_return_codes, jb_frame::ms, NULL, result, jb_info::resync_offset, TEST_EXECUTE, TEST_INIT, test_jb_lost_frame_insertion(), test_jb_populate_config(), and jb_frame::ts.
AST_TEST_DEFINE | ( | jitterbuffer_nominal_control_frames | ) |
Definition at line 260 of file test_jitterbuf.c.
References AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, cleanup(), DEFAULT_CODEC_INTERP_LEN, jb_info::frames_dropped, jb_info::frames_in, jb_info::frames_late, jb_info::frames_lost, jb_info::frames_ooo, jb_info::frames_out, jitterbuf::info, jb_destroy(), jb_get(), jb_getall(), jb_getinfo(), JB_INFO_PRINT_FRAME_DEBUG, jb_new(), JB_NUMERIC_TEST, JB_OK, jb_setconf(), JB_TEST_BEGIN, JB_TEST_END, JB_TYPE_CONTROL, jitter_buffer_return_codes, jb_frame::ms, NULL, result, jb_info::resync_offset, TEST_EXECUTE, TEST_INIT, test_jb_nominal_frame_insertion(), test_jb_populate_config(), and jb_frame::ts.
AST_TEST_DEFINE | ( | jitterbuffer_nominal_voice_frames | ) |
Definition at line 180 of file test_jitterbuf.c.
References AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, cleanup(), DEFAULT_CODEC_INTERP_LEN, jb_info::frames_dropped, jb_info::frames_in, jb_info::frames_late, jb_info::frames_lost, jb_info::frames_ooo, jb_info::frames_out, jitterbuf::info, jb_destroy(), jb_get(), jb_getall(), jb_getinfo(), JB_INFO_PRINT_FRAME_DEBUG, jb_new(), jb_next(), JB_NUMERIC_TEST, JB_OK, jb_setconf(), JB_TEST_BEGIN, JB_TEST_END, JB_TYPE_VOICE, jitter_buffer_return_codes, jb_frame::ms, NULL, result, jb_info::resync_offset, TEST_EXECUTE, TEST_INIT, test_jb_nominal_frame_insertion(), test_jb_populate_config(), and jb_frame::ts.
AST_TEST_DEFINE | ( | jitterbuffer_out_of_order_control | ) |
Definition at line 455 of file test_jitterbuf.c.
References AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, cleanup(), DEFAULT_CODEC_INTERP_LEN, jb_info::frames_dropped, jb_info::frames_in, jb_info::frames_late, jb_info::frames_lost, jb_info::frames_ooo, jb_info::frames_out, jitterbuf::info, jb_destroy(), jb_get(), jb_getall(), jb_getinfo(), JB_INFO_PRINT_FRAME_DEBUG, jb_new(), JB_NUMERIC_TEST, JB_OK, jb_setconf(), JB_TEST_BEGIN, JB_TEST_END, JB_TYPE_CONTROL, jitter_buffer_return_codes, jb_frame::ms, NULL, result, jb_info::resync_offset, TEST_EXECUTE, TEST_INIT, test_jb_out_of_order_frame_insertion(), test_jb_populate_config(), and jb_frame::ts.
AST_TEST_DEFINE | ( | jitterbuffer_out_of_order_voice | ) |
Definition at line 374 of file test_jitterbuf.c.
References AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, cleanup(), DEFAULT_CODEC_INTERP_LEN, jb_info::frames_dropped, jb_info::frames_in, jb_info::frames_late, jb_info::frames_lost, jb_info::frames_ooo, jb_info::frames_out, jitterbuf::info, jb_destroy(), jb_get(), jb_getall(), jb_getinfo(), JB_INFO_PRINT_FRAME_DEBUG, jb_new(), JB_NUMERIC_TEST, JB_OK, jb_setconf(), JB_TEST_BEGIN, JB_TEST_END, JB_TYPE_VOICE, jitter_buffer_return_codes, jb_frame::ms, NULL, result, jb_info::resync_offset, TEST_EXECUTE, TEST_INIT, test_jb_out_of_order_frame_insertion(), test_jb_populate_config(), and jb_frame::ts.
AST_TEST_DEFINE | ( | jitterbuffer_overflow_control | ) |
Definition at line 999 of file test_jitterbuf.c.
References AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, cleanup(), DEFAULT_CODEC_INTERP_LEN, jb_info::frames_dropped, jb_info::frames_in, jb_info::frames_late, jb_info::frames_lost, jb_info::frames_ooo, jb_info::frames_out, jitterbuf::info, jb_destroy(), jb_get(), jb_getall(), jb_getinfo(), JB_INFO_PRINT_FRAME_DEBUG, jb_new(), JB_NUMERIC_TEST, JB_OK, jb_setconf(), JB_TEST_BEGIN, JB_TEST_END, JB_TYPE_CONTROL, jb_frame::ms, NULL, result, jb_info::resync_offset, TEST_EXECUTE, TEST_INIT, test_jb_overflow_frame_insertion(), test_jb_populate_config(), and jb_frame::ts.
AST_TEST_DEFINE | ( | jitterbuffer_overflow_voice | ) |
Definition at line 929 of file test_jitterbuf.c.
References AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, cleanup(), DEFAULT_CODEC_INTERP_LEN, jb_info::frames_dropped, jb_info::frames_in, jb_info::frames_late, jb_info::frames_lost, jb_info::frames_ooo, jb_info::frames_out, jitterbuf::info, jb_destroy(), jb_get(), jb_getall(), jb_getinfo(), JB_INFO_PRINT_FRAME_DEBUG, jb_new(), JB_NUMERIC_TEST, JB_OK, jb_setconf(), JB_TEST_BEGIN, JB_TEST_END, JB_TYPE_VOICE, jb_frame::ms, NULL, result, jb_info::resync_offset, TEST_EXECUTE, TEST_INIT, test_jb_overflow_frame_insertion(), test_jb_populate_config(), and jb_frame::ts.
AST_TEST_DEFINE | ( | jitterbuffer_resynch_control | ) |
Definition at line 1085 of file test_jitterbuf.c.
References AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, cleanup(), DEFAULT_CODEC_INTERP_LEN, jb_info::frames_dropped, jb_info::frames_in, jb_info::frames_late, jb_info::frames_lost, jb_info::frames_ooo, jb_info::frames_out, jb_destroy(), jb_get(), jb_getall(), jb_getinfo(), JB_INFO_PRINT_FRAME_DEBUG, JB_INTERP, jb_new(), JB_NUMERIC_TEST, JB_OK, jb_setconf(), JB_TEST_BEGIN, JB_TEST_END, JB_TYPE_CONTROL, NULL, result, jb_conf::resync_threshold, TEST_EXECUTE, TEST_INIT, test_jb_populate_config(), and test_jb_resynch_frame_insertion().
AST_TEST_DEFINE | ( | jitterbuffer_resynch_voice | ) |
Definition at line 1160 of file test_jitterbuf.c.
References AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, cleanup(), DEFAULT_CODEC_INTERP_LEN, jb_info::frames_dropped, jb_info::frames_in, jb_info::frames_late, jb_info::frames_lost, jb_info::frames_ooo, jb_info::frames_out, jb_destroy(), jb_get(), jb_getall(), jb_getinfo(), JB_INFO_PRINT_FRAME_DEBUG, JB_INTERP, jb_new(), JB_NUMERIC_TEST, JB_OK, jb_setconf(), JB_TEST_BEGIN, JB_TEST_END, JB_TYPE_VOICE, NULL, result, jb_conf::resync_threshold, TEST_EXECUTE, TEST_INIT, test_jb_populate_config(), and test_jb_resynch_frame_insertion().
|
static |
Definition at line 1253 of file test_jitterbuf.c.
References AST_MODULE_LOAD_SUCCESS, and AST_TEST_REGISTER.
|
static |
Definition at line 117 of file test_jitterbuf.c.
|
static |
Definition at line 149 of file test_jitterbuf.c.
References args, ast_log, AST_LOG_ERROR, and buf.
|
static |
Definition at line 734 of file test_jitterbuf.c.
References ast_test_status_update, JB_DROP, jb_put(), and NULL.
Referenced by AST_TEST_DEFINE(), and AST_TEST_DEFINE().
|
static |
Definition at line 540 of file test_jitterbuf.c.
References ast_test_status_update, JB_DROP, jb_put(), and NULL.
Referenced by AST_TEST_DEFINE(), and AST_TEST_DEFINE().
|
static |
Definition at line 165 of file test_jitterbuf.c.
References ast_test_status_update, JB_DROP, jb_put(), and NULL.
Referenced by AST_TEST_DEFINE(), and AST_TEST_DEFINE().
|
static |
Definition at line 343 of file test_jitterbuf.c.
References ast_test_status_update, JB_DROP, jb_put(), and NULL.
Referenced by AST_TEST_DEFINE(), and AST_TEST_DEFINE().
|
static |
Definition at line 920 of file test_jitterbuf.c.
References jb_put(), and NULL.
Referenced by AST_TEST_DEFINE(), and AST_TEST_DEFINE().
|
static |
Definition at line 101 of file test_jitterbuf.c.
References DEFAULT_MAX_CONTIG_INTERP, DEFAULT_MAX_JITTERBUFFER, DEFAULT_RESYNCH_THRESHOLD, jb_conf::max_contig_interp, jb_conf::max_jitterbuf, jb_conf::resync_threshold, and jb_conf::target_extra.
Referenced by AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), and AST_TEST_DEFINE().
|
static |
Definition at line 1072 of file test_jitterbuf.c.
References jb_put(), and NULL.
Referenced by AST_TEST_DEFINE(), and AST_TEST_DEFINE().
|
static |
Definition at line 133 of file test_jitterbuf.c.
References args, ast_log, AST_LOG_WARNING, and buf.
|
static |
Definition at line 1236 of file test_jitterbuf.c.
References AST_TEST_UNREGISTER.
|
static |
Definition at line 1282 of file test_jitterbuf.c.
|
static |
Definition at line 1282 of file test_jitterbuf.c.
|
static |
Definition at line 88 of file test_jitterbuf.c.
Referenced by AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), and AST_TEST_DEFINE().