mgcp_test: add returncode check
The returncode of get_conn_id_from_response() is unchecked, which
is intentional since some of the test messages will intentionally cause
this function to fail (the response does not inclde a connection
identifier). This means it makes no sense to assert this function
to a fixed value.
In order to spot regressions better print a log message depending
on the return code.
Change-Id: I9bce9ca39b7751b557374b7ab57c6c9005bcdb7d
Fixes: Coverity CID#180534
diff --git a/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c
index 1c57347..ee49eef 100644
--- a/tests/mgcp/mgcp_test.c
+++ b/tests/mgcp/mgcp_test.c
@@ -636,6 +636,7 @@
int i;
struct mgcp_conn_rtp *conn = NULL;
char last_conn_id[256];
+ int rc;
cfg = mgcp_config_alloc();
@@ -675,9 +676,14 @@
OSMO_ASSERT(false);
}
- if (msg)
- get_conn_id_from_response(msg->data, last_conn_id,
- sizeof(last_conn_id));
+ if (msg) {
+ rc = get_conn_id_from_response(msg->data, last_conn_id,
+ sizeof(last_conn_id));
+ if (rc)
+ printf("(response contains a connection id)\n");
+ else
+ printf("(response does not contain a connection id)\n");
+ }
msgb_free(msg);