From c460deb2f1135503b1a4d4eaf1f33d388d10e80a Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Sat, 9 Dec 2023 02:44:59 +0700 Subject: [PATCH] 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 --- tests/soft_uart/soft_uart_test.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/soft_uart/soft_uart_test.c b/tests/soft_uart/soft_uart_test.c index 0e84d5a62..9ca9bd9b7 100644 --- a/tests/soft_uart/soft_uart_test.c +++ b/tests/soft_uart/soft_uart_test.c @@ -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);