Asterisk - The Open Source Telephony Project
18.5.0
|
Format Capabilities API Unit Tests. More...
#include "asterisk.h"
#include "asterisk/test.h"
#include "asterisk/module.h"
#include "asterisk/codec.h"
#include "asterisk/frame.h"
#include "asterisk/format.h"
#include "asterisk/format_cap.h"
Go to the source code of this file.
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
AST_TEST_DEFINE (format_cap_alloc) | |
AST_TEST_DEFINE (format_cap_append_single) | |
AST_TEST_DEFINE (format_cap_append_multiple) | |
AST_TEST_DEFINE (format_cap_append_all_unknown) | |
AST_TEST_DEFINE (format_cap_append_all_audio) | |
AST_TEST_DEFINE (format_cap_append_duplicate) | |
AST_TEST_DEFINE (format_cap_append_from_cap) | |
AST_TEST_DEFINE (format_cap_append_from_cap_duplicate) | |
AST_TEST_DEFINE (format_cap_set_framing) | |
AST_TEST_DEFINE (format_cap_remove_single) | |
AST_TEST_DEFINE (format_cap_remove_multiple) | |
AST_TEST_DEFINE (format_cap_remove_bytype) | |
AST_TEST_DEFINE (format_cap_remove_all) | |
AST_TEST_DEFINE (format_cap_get_compatible_format) | |
AST_TEST_DEFINE (format_cap_iscompatible_format) | |
AST_TEST_DEFINE (format_cap_get_compatible) | |
AST_TEST_DEFINE (format_cap_iscompatible) | |
AST_TEST_DEFINE (format_cap_get_names) | |
AST_TEST_DEFINE (format_cap_best_by_type) | |
AST_TEST_DEFINE (format_cap_replace_from_cap) | |
static int | load_module (void) |
static int | test_law_clone (const struct ast_format *src, struct ast_format *dst) |
static enum ast_format_cmp_res | test_law_cmp (const struct ast_format *format1, const struct ast_format *format2) |
static void | test_law_destroy (struct ast_format *format) |
static int | test_law_length (unsigned int samples) |
static int | test_law_samples (struct ast_frame *frame) |
static int | unload_module (void) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Format capabilities API 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, .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 struct ast_codec | test_law |
static struct ast_format_interface | test_law_interface |
Format Capabilities API Unit Tests.
Definition in file test_format_cap.c.
|
static |
Definition at line 1477 of file test_format_cap.c.
|
static |
Definition at line 1477 of file test_format_cap.c.
struct ast_module* AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 1477 of file test_format_cap.c.
AST_TEST_DEFINE | ( | format_cap_alloc | ) |
Definition at line 41 of file test_format_cap.c.
References ao2_ref, ast_format_cap_alloc, AST_FORMAT_CAP_FLAG_DEFAULT, AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, sip_to_pjsip::info(), TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | format_cap_append_single | ) |
Definition at line 67 of file test_format_cap.c.
References ao2_cleanup, ast_codec_get(), ast_format_cap_alloc, ast_format_cap_append, ast_format_cap_count(), AST_FORMAT_CAP_FLAG_DEFAULT, ast_format_cap_get_format(), ast_format_cap_get_format_framing(), ast_format_create(), AST_MEDIA_TYPE_AUDIO, AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, format, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | format_cap_append_multiple | ) |
Definition at line 128 of file test_format_cap.c.
References alaw, ao2_cleanup, ao2_ref, ast_codec_get(), ast_format_cap_alloc, ast_format_cap_append, ast_format_cap_count(), AST_FORMAT_CAP_FLAG_DEFAULT, ast_format_cap_get_format(), ast_format_cap_get_format_framing(), ast_format_create(), AST_MEDIA_TYPE_AUDIO, AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, TEST_INIT, and ulaw.
AST_TEST_DEFINE | ( | format_cap_append_all_unknown | ) |
Definition at line 217 of file test_format_cap.c.
References ao2_cleanup, ast_codec_get_max(), ast_format_cap_alloc, ast_format_cap_append_by_type(), ast_format_cap_count(), AST_FORMAT_CAP_FLAG_DEFAULT, ast_format_cap_has_type(), AST_MEDIA_TYPE_AUDIO, AST_MEDIA_TYPE_UNKNOWN, AST_MEDIA_TYPE_VIDEO, AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | format_cap_append_all_audio | ) |
Definition at line 254 of file test_format_cap.c.
References ao2_cleanup, ast_format_cap_alloc, ast_format_cap_append_by_type(), AST_FORMAT_CAP_FLAG_DEFAULT, ast_format_cap_has_type(), AST_MEDIA_TYPE_AUDIO, AST_MEDIA_TYPE_IMAGE, AST_MEDIA_TYPE_TEXT, AST_MEDIA_TYPE_VIDEO, AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | format_cap_append_duplicate | ) |
Definition at line 294 of file test_format_cap.c.
References ao2_cleanup, ast_codec_get(), ast_format_cap_alloc, ast_format_cap_append, ast_format_cap_count(), AST_FORMAT_CAP_FLAG_DEFAULT, ast_format_cap_get_format(), ast_format_cap_get_format_framing(), ast_format_create(), ast_format_create_named(), AST_MEDIA_TYPE_AUDIO, AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, format, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | format_cap_append_from_cap | ) |
Definition at line 381 of file test_format_cap.c.
References ao2_cleanup, ast_format_cap_alloc, ast_format_cap_append_by_type(), ast_format_cap_append_from_cap(), AST_FORMAT_CAP_FLAG_DEFAULT, ast_format_cap_has_type(), AST_MEDIA_TYPE_AUDIO, AST_MEDIA_TYPE_UNKNOWN, AST_MEDIA_TYPE_VIDEO, AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | format_cap_append_from_cap_duplicate | ) |
Definition at line 430 of file test_format_cap.c.
References ao2_cleanup, ast_format_cap_alloc, ast_format_cap_append_by_type(), ast_format_cap_append_from_cap(), ast_format_cap_count(), AST_FORMAT_CAP_FLAG_DEFAULT, ast_format_cap_has_type(), AST_MEDIA_TYPE_AUDIO, AST_MEDIA_TYPE_UNKNOWN, AST_MEDIA_TYPE_VIDEO, AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | format_cap_set_framing | ) |
Definition at line 493 of file test_format_cap.c.
References alaw, ao2_cleanup, ast_codec_get(), ast_format_cap_alloc, ast_format_cap_append, AST_FORMAT_CAP_FLAG_DEFAULT, ast_format_cap_get_format_framing(), ast_format_cap_get_framing(), ast_format_cap_set_framing(), ast_format_create(), ast_format_get_default_ms(), AST_MEDIA_TYPE_AUDIO, AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, TEST_INIT, and ulaw.
AST_TEST_DEFINE | ( | format_cap_remove_single | ) |
Definition at line 567 of file test_format_cap.c.
References ao2_cleanup, ast_codec_get(), ast_format_cap_alloc, ast_format_cap_append, ast_format_cap_count(), AST_FORMAT_CAP_FLAG_DEFAULT, ast_format_cap_remove(), ast_format_create(), AST_MEDIA_TYPE_AUDIO, AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, format, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | format_cap_remove_multiple | ) |
Definition at line 621 of file test_format_cap.c.
References alaw, ao2_cleanup, ast_codec_get(), ast_format_cap_alloc, ast_format_cap_append, ast_format_cap_count(), AST_FORMAT_CAP_FLAG_DEFAULT, ast_format_cap_get_format(), ast_format_cap_remove(), ast_format_create(), AST_MEDIA_TYPE_AUDIO, AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, TEST_INIT, and ulaw.
AST_TEST_DEFINE | ( | format_cap_remove_bytype | ) |
Definition at line 699 of file test_format_cap.c.
References ao2_cleanup, ast_format_cap_alloc, ast_format_cap_append_by_type(), AST_FORMAT_CAP_FLAG_DEFAULT, ast_format_cap_has_type(), ast_format_cap_remove_by_type(), AST_MEDIA_TYPE_AUDIO, AST_MEDIA_TYPE_UNKNOWN, AST_MEDIA_TYPE_VIDEO, AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | format_cap_remove_all | ) |
Definition at line 736 of file test_format_cap.c.
References ao2_cleanup, ast_format_cap_alloc, ast_format_cap_append_by_type(), ast_format_cap_count(), AST_FORMAT_CAP_FLAG_DEFAULT, ast_format_cap_remove_by_type(), AST_MEDIA_TYPE_UNKNOWN, AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | format_cap_get_compatible_format | ) |
Definition at line 771 of file test_format_cap.c.
References alaw, ao2_cleanup, ast_codec_get(), ast_format_cap_alloc, ast_format_cap_append, AST_FORMAT_CAP_FLAG_DEFAULT, ast_format_cap_get_compatible_format(), ast_format_create(), AST_MEDIA_TYPE_AUDIO, AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, TEST_INIT, and ulaw.
AST_TEST_DEFINE | ( | format_cap_iscompatible_format | ) |
Definition at line 845 of file test_format_cap.c.
References alaw, ao2_cleanup, ast_codec_get(), ast_format_cap_alloc, ast_format_cap_append, AST_FORMAT_CAP_FLAG_DEFAULT, ast_format_cap_iscompatible_format(), AST_FORMAT_CMP_NOT_EQUAL, ast_format_create(), AST_MEDIA_TYPE_AUDIO, AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, TEST_INIT, and ulaw.
AST_TEST_DEFINE | ( | format_cap_get_compatible | ) |
Definition at line 909 of file test_format_cap.c.
References alaw, ao2_cleanup, ast_codec_get(), ast_format_cap_alloc, ast_format_cap_append, ast_format_cap_count(), AST_FORMAT_CAP_FLAG_DEFAULT, ast_format_cap_get_compatible(), ast_format_create(), AST_MEDIA_TYPE_AUDIO, AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, TEST_INIT, and ulaw.
AST_TEST_DEFINE | ( | format_cap_iscompatible | ) |
Definition at line 996 of file test_format_cap.c.
References alaw, ao2_cleanup, ast_codec_get(), ast_format_cap_alloc, ast_format_cap_append, AST_FORMAT_CAP_FLAG_DEFAULT, ast_format_cap_iscompatible(), ast_format_create(), AST_MEDIA_TYPE_AUDIO, AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, TEST_INIT, and ulaw.
AST_TEST_DEFINE | ( | format_cap_get_names | ) |
Definition at line 1070 of file test_format_cap.c.
References alaw, ao2_cleanup, ast_codec_get(), ast_format_cap_alloc, ast_format_cap_append, AST_FORMAT_CAP_FLAG_DEFAULT, ast_format_cap_get_names(), AST_FORMAT_CAP_NAMES_LEN, ast_format_create(), AST_MEDIA_TYPE_AUDIO, ast_str_alloca, ast_str_buffer(), AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, TEST_INIT, and ulaw.
AST_TEST_DEFINE | ( | format_cap_best_by_type | ) |
Definition at line 1170 of file test_format_cap.c.
References alaw, ao2_cleanup, ao2_ref, ast_codec_get(), ast_format_cap_alloc, ast_format_cap_append, AST_FORMAT_CAP_FLAG_DEFAULT, ast_format_cap_get_best_by_type(), ast_format_cmp(), AST_FORMAT_CMP_EQUAL, ast_format_create(), AST_MEDIA_TYPE_AUDIO, AST_MEDIA_TYPE_IMAGE, AST_MEDIA_TYPE_TEXT, AST_MEDIA_TYPE_UNKNOWN, AST_MEDIA_TYPE_VIDEO, AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, h263, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, TEST_INIT, and ulaw.
AST_TEST_DEFINE | ( | format_cap_replace_from_cap | ) |
Definition at line 1311 of file test_format_cap.c.
References alaw, ao2_cleanup, ast_codec_get(), ast_format_cap_alloc, ast_format_cap_append, ast_format_cap_count(), AST_FORMAT_CAP_FLAG_DEFAULT, ast_format_cap_identical(), ast_format_cap_replace_from_cap(), ast_format_create(), AST_MEDIA_TYPE_AUDIO, AST_MEDIA_TYPE_UNKNOWN, AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, TEST_INIT, and ulaw.
|
static |
Definition at line 1450 of file test_format_cap.c.
References ast_codec_register, ast_format_interface_register, AST_MODULE_LOAD_SUCCESS, and AST_TEST_REGISTER.
|
static |
Definition at line 1300 of file test_format_cap.c.
|
static |
Definition at line 1290 of file test_format_cap.c.
References AST_FORMAT_CMP_EQUAL, AST_FORMAT_CMP_NOT_EQUAL, ast_log, and LOG_ERROR.
|
static |
Definition at line 1296 of file test_format_cap.c.
|
static |
Definition at line 1272 of file test_format_cap.c.
|
static |
|
static |
|
static |
Definition at line 1477 of file test_format_cap.c.
|
static |
Definition at line 1477 of file test_format_cap.c.
|
static |
Definition at line 1277 of file test_format_cap.c.
|
static |
Definition at line 1305 of file test_format_cap.c.