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
This commit is contained in:
Neels Hofmeyr 2023-12-10 07:12:39 +01:00
parent 9bea6eb78c
commit 17b5701f19
1 changed files with 6 additions and 2 deletions

View File

@ -2137,7 +2137,7 @@ static bool codec_decision(struct mgcp_conn_rtp *conn, unsigned int index_conn_s
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 @@ static void test_mgcp_codec_decide(void)
int rc;
int conn_i;
int c;
bool ok = true;
printf("#%d: %s\n", i, t->descr);
@ -2186,9 +2187,12 @@ static void test_mgcp_codec_decide(void)
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)