aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2023-12-09 02:44:59 +0700
committerlaforge <laforge@osmocom.org>2023-12-10 11:20:40 +0000
commitc460deb2f1135503b1a4d4eaf1f33d388d10e80a (patch)
tree331f8d285080ea5c040f8611db30c0289ca71039
parent9c972934f9d86eea045a282769a6d22216b79529 (diff)
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
-rw-r--r--tests/soft_uart/soft_uart_test.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/soft_uart/soft_uart_test.c b/tests/soft_uart/soft_uart_test.c
index 0e84d5a6..9ca9bd9b 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);