47 info->name =
"format_cap_alloc";
48 info->category =
"/main/format_cap/";
49 info->summary =
"format capabilities allocation unit test";
51 "Test that allocation of a format capabilities structure succeeds";
76 info->name = __PRETTY_FUNCTION__;
77 info->category =
"/main/format_cap/";
78 info->summary =
"format capabilities adding unit test";
80 "Test that adding a single format to a format capabilities structure succeeds";
117 }
else if (retrieved !=
format) {
139 info->name = __PRETTY_FUNCTION__;
140 info->category =
"/main/format_cap/";
141 info->summary =
"format capabilities adding unit test";
143 "Test that adding multiple formats to a format capabilities structure succeeds";
195 }
else if (retrieved != ulaw_format) {
207 }
else if (retrieved != alaw_format) {
223 info->name = __PRETTY_FUNCTION__;
224 info->category =
"/main/format_cap/";
225 info->summary =
"format capabilities adding unit test";
227 "Test that adding of all formats to a format capabilities structure succeeds";
260 info->name = __PRETTY_FUNCTION__;
261 info->category =
"/main/format_cap/";
262 info->summary =
"format capabilities adding unit test";
264 "Test that adding of all audio formats to a format capabilities structure succeeds";
304 info->name = __PRETTY_FUNCTION__;
305 info->category =
"/main/format_cap/";
306 info->summary =
"format capabilities duplication unit test";
308 "Test that adding a single format multiple times to a capabilities structure results in only a single format";
370 }
else if (retrieved !=
format) {
388 info->name = __PRETTY_FUNCTION__;
389 info->category =
"/main/format_cap/";
390 info->summary =
"format capabilities append unit test";
392 "Test that appending video formats from one capabilities structure to another succeeds";
420 ast_test_status_update(
test,
"Successfully appended video formats to destination capabilities but it no longer contains audio formats\n");
435 unsigned int total_count;
439 info->name = __PRETTY_FUNCTION__;
440 info->category =
"/main/format_cap/";
441 info->summary =
"format capabilities append duplicate unit test";
443 "Test that appending capabilities structures multiple times does not result in duplicate formats";
473 ast_test_status_update(
test,
"Successfully appended video formats to destination capabilities but it no longer contains audio formats\n");
488 ast_test_validate(
test, count == total_count);
503 info->name =
"format_cap_set_framing";
504 info->category =
"/main/format_cap/";
505 info->summary =
"format capabilities framing unit test";
507 "Test that global framing on a format capabilities structure is used when it should be";
559 ast_test_status_update(
test,
"Added alaw format to capabilities structure with no explicit framing but did not get global back\n");
575 info->name =
"format_cap_remove_single";
576 info->category =
"/main/format_cap/";
577 info->summary =
"format capabilities removal unit test";
579 "Test that removing a single format from a format capabilities structure succeeds";
632 info->name =
"format_cap_remove_multiple";
633 info->category =
"/main/format_cap/";
634 info->summary =
"format capabilities removal unit test";
636 "Test that removing a format from a format capabilities structure containing multiple formats succeeds";
691 }
else if (retrieved != alaw_format) {
705 info->name =
"format_cap_remove_bytype";
706 info->category =
"/main/format_cap/";
707 info->summary =
"format capabilities removal unit test";
709 "Test that removal of a specific type of format from a format capabilities structure succeeds";
742 info->name =
"format_cap_remove_all";
743 info->category =
"/main/format_cap/";
744 info->summary =
"format capabilities removal unit test";
746 "Test that removal of all formats from a format capabilities structure succeeds";
782 info->name =
"format_cap_get_compatible_format";
783 info->category =
"/main/format_cap/";
784 info->summary =
"format capabilities negotiation unit test";
786 "Test that getting a compatible format from a capabilities structure succeeds";
837 }
else if (compatible != ulaw_format) {
855 info->name =
"format_cap_iscompatible_format";
856 info->category =
"/main/format_cap/";
857 info->summary =
"format capabilities negotiation unit test";
859 "Test that checking whether a format is compatible with a capabilities structure succeeds";
921 info->name =
"format_cap_get_compatible";
922 info->category =
"/main/format_cap/";
923 info->summary =
"format capabilities negotiation unit test";
925 "Test that getting the compatible formats between two capabilities structures succeeds";
944 if (!compatible_caps) {
1007 info->name =
"format_cap_iscompatible";
1008 info->category =
"/main/format_cap/";
1009 info->summary =
"format capabilities negotiation unit test";
1011 "Test that checking if there are compatible formats between two capabilities structures succeeds";
1084 info->name =
"format_cap_get_names";
1085 info->category =
"/main/format_cap/";
1086 info->summary =
"Test getting the names of formats";
1088 "Test that obtaining the names from a format capabilities structure\n" 1089 "produces the expected output.";
1183 info->name = __PRETTY_FUNCTION__;
1184 info->category =
"/main/format_cap/";
1185 info->summary =
"format capabilities best by type unit test";
1187 "Test that we can get the best format type out of a capabilities structure";
1259 ast_test_validate(
test, best_format ==
NULL);
1262 ast_test_validate(
test, best_format ==
NULL);
1279 .description =
"format cap unit test codec",
1281 .sample_rate = 8000,
1292 ast_log(
LOG_ERROR,
"Comparing format1 %p and format2 %p\n", format1, format2);
1324 info->name = __PRETTY_FUNCTION__;
1325 info->category =
"/main/format_cap/";
1326 info->summary =
"format capabilities adding unit test";
1328 "Test that adding multiple formats to a format capabilities structure succeeds";
1337 if (!caps || !replace_caps || !result_caps) {
1355 if (!ulaw_format_variant) {
#define AST_MODULE_INFO_STANDARD(keystr, desc)
const char * name
Name for this codec.
Asterisk main include file. File version handling, generic pbx functions.
static struct ast_codec ulaw
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
#define AST_TEST_REGISTER(cb)
#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.
static struct ast_codec alaw
int ast_codec_get_max(void)
Retrieve the current maximum identifier for codec iteration.
#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...)
Asterisk internal frame definitions.
#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 ...
static struct ast_codec h263
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
#define AST_TEST_UNREGISTER(cb)
Data structure associated with a single frame of data.
#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.