Asterisk - The Open Source Telephony Project
21.4.1
|
Core Format API Unit Tests. More...
#include "asterisk.h"
#include "asterisk/test.h"
#include "asterisk/module.h"
#include "asterisk/codec.h"
#include "asterisk/format.h"
Go to the source code of this file.
Data Structures | |
struct | callbacks_called |
Tracking object used to verify format attribute callbacks. More... | |
struct | test_core_format_pvt |
A test piece of data to associate with test_core_format_attr. More... | |
Macros | |
#define | TEST_CATEGORY "/main/core_format/" |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
AST_TEST_DEFINE (format_create) | |
AST_TEST_DEFINE (format_create_attr) | |
AST_TEST_DEFINE (format_retrieve_attr) | |
AST_TEST_DEFINE (format_clone) | |
AST_TEST_DEFINE (format_cmp_same_codec) | |
AST_TEST_DEFINE (format_cmp_different_codec) | |
AST_TEST_DEFINE (format_attr_cmp_same_codec) | |
AST_TEST_DEFINE (format_joint_same_codec) | |
AST_TEST_DEFINE (format_attr_joint_same_codec) | |
AST_TEST_DEFINE (format_joint_different_codec) | |
AST_TEST_DEFINE (format_copy) | |
AST_TEST_DEFINE (format_attribute_set_without_interface) | |
AST_TEST_DEFINE (format_attribute_get_without_interface) | |
AST_TEST_DEFINE (format_parse_sdp_fmtp_without_interface) | |
AST_TEST_DEFINE (format_parse_and_generate_sdp_fmtp) | |
static int | load_module (void) |
static const void * | test_core_format_attribute_get (const struct ast_format *format, const char *name) |
Format attribute callback for retrieving an attribute. | |
static struct ast_format * | test_core_format_attribute_set (const struct ast_format *format, const char *name, const char *value) |
Format attribute callback for setting an attribute on a format. | |
static int | test_core_format_clone (const struct ast_format *src, struct ast_format *dst) |
Format attribute callback called during format cloning. | |
static enum ast_format_cmp_res | test_core_format_cmp (const struct ast_format *format1, const struct ast_format *format2) |
Format attribute callback called during format comparison. | |
static void | test_core_format_destroy (struct ast_format *format) |
Format attribute callback for when format attributes are to be destroyed. | |
static void | test_core_format_generate_sdp_fmtp (const struct ast_format *format, unsigned int payload, struct ast_str **str) |
Format attribute callback to generate an SDP fmtp line from a format. | |
static struct ast_format * | test_core_format_get_joint (const struct ast_format *format1, const struct ast_format *format2) |
Format attribute callback called during joint format capability. More... | |
static int | test_core_format_init (struct ast_test_info *info, struct ast_test *test) |
static struct ast_format * | test_core_format_parse_sdp_fmtp (const struct ast_format *format, const char *attributes) |
Format attribute callback to construct a format from an SDP fmtp line. | |
static int | unload_module (void) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Core format 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 callbacks_called | test_callbacks_called |
A global tracking object. Cleared out by the test init cb. | |
static struct ast_format_interface | test_core_format_attr |
A format attribute 'module' used by the unit tests. | |
static struct ast_codec | test_core_format_codec |
A test codec for these unit tests. Should be used with test_core_format . | |
Core Format API Unit Tests.
Definition in file test_core_format.c.
|
static |
Format attribute callback called during joint format capability.
field_one
and field_two
Definition at line 163 of file test_core_format.c.
References ast_format_clone(), ast_format_get_attribute_data(), test_core_format_pvt::field_one, test_core_format_pvt::field_two, callbacks_called::format_get_joint, and test_callbacks_called.