laforge has submitted this change. (
https://gerrit.osmocom.org/c/libosmocore/+/35292?usp=email )
Change subject: tests/soft_uart: assert that osmo_soft_uart_rx_ubits() returns 0
......................................................................
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
---
M tests/soft_uart/soft_uart_test.c
1 file changed, 17 insertions(+), 1 deletion(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, approved
diff --git a/tests/soft_uart/soft_uart_test.c b/tests/soft_uart/soft_uart_test.c
index 0e84d5a..9ca9bd9 100644
--- a/tests/soft_uart/soft_uart_test.c
+++ b/tests/soft_uart/soft_uart_test.c
@@ -68,12 +68,14 @@
{
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);
--
To view, visit
https://gerrit.osmocom.org/c/libosmocore/+/35292?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I675f4089cc990be5fcda792276b6808742f6f0d7
Gerrit-Change-Number: 35292
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: merged