tests/soft_uart: assert that osmo_soft_uart_rx_ubits() returns 0

According to Coverity, we check return value of this function in
all other cases except this one (9 out of 10 times), so let's add
the missing assert(), just to be sure.

Change-Id: I675f4089cc990be5fcda792276b6808742f6f0d7
Fixes: CID#336557
This commit is contained in:
Vadim Yanitskiy 2023-12-09 02:44:59 +07:00 committed by laforge
parent 9c972934f9
commit c460deb2f1
1 changed files with 3 additions and 1 deletions

View File

@ -68,12 +68,14 @@ static void test_rx_exec(struct osmo_soft_uart *suart,
{
for (unsigned int i = 0; input[i] != '\0'; i++) {
ubit_t ubit;
int rc;
switch (input[i]) {
case '0':
case '1':
ubit = input[i] - '0';
osmo_soft_uart_rx_ubits(suart, &ubit, 1);
rc = osmo_soft_uart_rx_ubits(suart, &ubit, 1);
OSMO_ASSERT(rc == 0); /* 0 on success */
break;
case 'F':
printf("%s() @ %u: flush the Rx buffer\n", __func__, i);