mgcp_test: fix false negatives in test output
If one test fails, do not print failure for all following tests as well.
Change-Id: I196880b4b34a672ef45042c25f89bc1684363567
diff --git a/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c
index 621ee77..c76bd9d 100644
--- a/tests/mgcp/mgcp_test.c
+++ b/tests/mgcp/mgcp_test.c
@@ -2137,7 +2137,7 @@
static void test_mgcp_codec_decide(void)
{
int i;
- bool ok = true;
+ bool ok_all = true;
printf("\nTesting mgcp_codec_find_convertible()\n");
for (i = 0; i < ARRAY_SIZE(test_mgcp_codec_find_convertible_cases); i++) {
@@ -2146,6 +2146,7 @@
int rc;
int conn_i;
int c;
+ bool ok = true;
printf("#%d: %s\n", i, t->descr);
@@ -2186,9 +2187,12 @@
printf(" ===> SUCCESS: codec decision as expected!\n");
else
printf(" ===> FAIL: unexpected codec decision!\n");
+
+ if (!ok)
+ ok_all = false;
}
- OSMO_ASSERT(ok);
+ OSMO_ASSERT(ok_all);
}
void test_conn_id_matching(void)