49{
54 const char *joint_string;
55 char *stripped_joint;
57 int rc;
58 int i;
59
60 ast_test_status_update(
test,
"Testing local: (%s), remote: (%s), pref: (%-12s), outgoing: (%s), expected: (%s) expected result: (%s)\n",
61 local_string, remote_string, pref_string, is_outgoing ? "yes" : "no ", expected_string,
63
65
67 if (rc != 0) {
69 expected_result ==
AST_TEST_FAIL ?
"E" :
"Une", local_string);
71 }
73 if (rc != 0) {
75 expected_result ==
AST_TEST_FAIL ?
"E" :
"Une", remote_string);
77 }
78
80 if (rc != 0) {
84 }
85
91 }
92
95 for(i = 0; i <= strlen(stripped_joint); i++) {
96 if(stripped_joint[i] == '|') {
97 stripped_joint[i] = ',';
98 }
99 }
100
101 if (!joint_string || strcmp(stripped_joint, expected_string) != 0) {
103 expected_result ==
AST_TEST_FAIL ?
"E" :
"Une", expected_string, stripped_joint);
105 }
106
108}
int ast_sip_call_codec_str_to_pref(struct ast_flags *pref, const char *pref_str, int is_outgoing)
Convert a call codec preference string to preference flags.
struct ast_format_cap * ast_sip_create_joint_call_cap(const struct ast_format_cap *remote, struct ast_format_cap *local, enum ast_media_type media_type, struct ast_flags codec_pref)
Create joint capabilities.
char * ast_str_truncate(struct ast_str *buf, ssize_t len)
Truncates the enclosed string to the given length.
size_t attribute_pure ast_str_strlen(const struct ast_str *buf)
Returns the current length of the string stored within buf.
#define ast_str_alloca(init_len)
Structure used to handle boolean flags.
Support for dynamic strings.
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.