Harald Welte has submitted this change and it was merged.

Change subject: tests: utils_test: Fix test failure when compiling with -O0
......................................................................


tests: utils_test: Fix test failure when compiling with -O0

It seems with default flags in_buf was being memzeroed by the compiler.
When compiling with -O0, that's not the case anymore and printf prints
after first 16 bytes, printing extra garbage which doesn't match the
expected output.

Change-Id: I736c1e4d625f647d3bb794fa717256e9dbf36e87
---
M tests/utils/utils_test.c
1 file changed, 1 insertion(+), 0 deletions(-)

Approvals:
  Vadim Yanitskiy: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/tests/utils/utils_test.c b/tests/utils/utils_test.c
index b4f7cd3..f358e9a 100644
--- a/tests/utils/utils_test.c
+++ b/tests/utils/utils_test.c
@@ -334,6 +334,7 @@
 
        printf("\nTesting string escaping\n");
        printf("- all chars from 0 to 255 in batches of 16:\n");
+       in_buf[16] = '\0';
        for (j = 0; j < 16; j++) {
                for (i = 0; i < 16; i++)
                        in_buf[i] = (j << 4) | i;

-- 
To view, visit https://gerrit.osmocom.org/6236
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I736c1e4d625f647d3bb794fa717256e9dbf36e87
Gerrit-PatchSet: 2
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <pes...@sysmocom.de>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msur...@sysmocom.de>
Gerrit-Reviewer: Vadim Yanitskiy <axilira...@gmail.com>

Reply via email to