fixeria has uploaded this change for review.

View Change

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(-)

git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/92/35292/1
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 change 35292. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I675f4089cc990be5fcda792276b6808742f6f0d7
Gerrit-Change-Number: 35292
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de>
Gerrit-MessageType: newchange