mirror of https://gerrit.osmocom.org/libosmocore
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
This commit is contained in:
parent
41911d0380
commit
6de34ee46b
|
@ -334,6 +334,7 @@ static void str_escape_test(void)
|
|||
|
||||
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;
|
||||
|
|
Loading…
Reference in New Issue