39 #define TEST_CATEGORY "/main/core_format/" 72 .
name =
"test_core_format_codec",
73 .description =
"Unit test codec used by test_core_format",
149 if (!memcmp(pvt1, pvt2,
sizeof(*pvt1))) {
195 if (!strcmp(name,
"one")) {
197 }
else if (!strcmp(name,
"two")) {
210 if (!strcmp(name,
"one")) {
212 }
else if (!strcmp(name,
"two")) {
260 info->name = __PRETTY_FUNCTION__;
262 info->summary =
"Format creation unit test";
264 "Test creation of a format";
306 info->name = __PRETTY_FUNCTION__;
308 info->summary =
"Format creation w/ attributes unit test";
310 "Test creation of a format with attributes";
332 if (!format_w_attr) {
357 info->name = __PRETTY_FUNCTION__;
359 info->summary =
"Format attribute retrieval unit test";
361 "Test retrieval of format attributes";
380 if (!format_w_attr) {
407 info->name = __PRETTY_FUNCTION__;
409 info->summary =
"Format cloning unit test";
411 "Test cloning of a format";
433 if (!format_w_attr) {
449 }
else if (clone ==
format) {
466 }
else if (clone == format_w_attr) {
489 info->name = __PRETTY_FUNCTION__;
491 info->summary =
"Format comparison unit test";
493 "Test comparison of two different formats with same codec";
545 info->name = __PRETTY_FUNCTION__;
547 info->summary =
"Format comparison unit test";
549 "Test comparison of two different formats with different codec";
596 info->name = __PRETTY_FUNCTION__;
598 info->summary =
"Format with attributes comparison unit test";
600 "Test comparison of two different formats with attributes with same codec";
658 info->name = __PRETTY_FUNCTION__;
660 info->summary =
"Joint format unit test";
662 "Test joint format creation using two different formats with same codec";
709 info->name = __PRETTY_FUNCTION__;
711 info->summary =
"Joint format attribute unit test";
713 "Test joint format creation using two different formats with attributes and with same codec";
753 ast_test_validate(
test, strcmp(
"a=fmtp:100 one=5;two=0\r\n",
ast_str_buffer(fmtp)) == 0);
772 info->name = __PRETTY_FUNCTION__;
774 info->summary =
"Joint format unit test";
776 "Test that there is no joint format between two different formats with different codec";
823 info->name = __PRETTY_FUNCTION__;
825 info->summary =
"Format copying unit test";
827 "Test copying of a format";
865 info->name = __PRETTY_FUNCTION__;
867 info->summary =
"Format attribute setting unit test";
869 "Test that attribute setting on a format without an interface fails";
904 info->name = __PRETTY_FUNCTION__;
906 info->summary =
"Format attribute retrieval unit test";
908 "Test that attribute retrieval on a format without an interface fails";
942 info->name = __PRETTY_FUNCTION__;
944 info->summary =
"Format sdp parse unit test";
946 "Test that sdp parsing on a format without an interface fails";
965 if (generated !=
format) {
982 info->name = __PRETTY_FUNCTION__;
984 info->summary =
"Format sdp parse/generate unit test";
986 "Test that sdp parsing and generation on a format with an interface succeeds";
1005 if (
format == generated) {
1012 ast_test_validate(
test, strcmp(
"a=fmtp:8 one=1000;two=256\r\n",
ast_str_buffer(fmtp)) == 0);
Contains all the initialization information required to store a new test definition.
#define AST_MODULE_INFO_STANDARD(keystr, desc)
const char * name
Name for this codec.
Asterisk main include file. File version handling, generic pbx functions.
int ast_test_register_init(const char *category, ast_test_init_cb_t *cb)
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
#define AST_TEST_REGISTER(cb)
int ast_str_append(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Append to a thread local dynamic string.
static int copy(char *infile, char *outfile)
Utility function to copy a file.
#define ast_str_alloca(init_len)
struct ast_codec * ast_codec_get(const char *name, enum ast_media_type type, unsigned int sample_rate)
Retrieve a codec given a name, type, and sample rate.
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
#define ast_test_status_update(a, b, c...)
int format_generate_sdp_fmtp
#define ao2_ref(o, delta)
#define ast_codec_register(codec)
This function is used to register a codec with the Asterisk core. Registering allows it to be passed ...
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
#define AST_TEST_UNREGISTER(cb)
struct sla_ringing_trunk * first
int format_parse_sdp_fmtp
#define ast_calloc(num, len)
A wrapper for calloc()
Module has failed to load, may be in an inconsistent state.
Tracking object used to verify format attribute callbacks.
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.
static snd_pcm_format_t format
Represents a media codec within Asterisk.