aboutsummaryrefslogtreecommitdiffstats
path: root/tests/a5
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2018-05-16 21:12:12 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2018-05-16 21:13:58 +0200
commit16e205bfb2e86685ba5abf77d61dc3e8c39ee568 (patch)
tree550e7a80a4e9cef777af9dc24a66aa5a525d4dc5 /tests/a5
parent977afaae343f38909d6bb6cb74b6ff846c647cb0 (diff)
tests: a5_test: Print wrong buffer correctly on error
Before this patch, osmo_hexdump is called stacked in th esame printf function. As a result, the first returned buffer is overwriten by the second, which means the printed buffers will show as the same always. Change-Id: I364328a59da31537c6c9b969e34edd360b685081
Diffstat (limited to 'tests/a5')
-rw-r--r--tests/a5/a5_test.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/a5/a5_test.c b/tests/a5/a5_test.c
index 6d7cc3c4..69f10355 100644
--- a/tests/a5/a5_test.c
+++ b/tests/a5/a5_test.c
@@ -48,7 +48,9 @@ static inline bool print_a5(int n, int k, const char * dir, const ubit_t * out,
osmo_hexparse(block, res, len);
osmo_ubit2pbit(buf, out, 114);
if (0 != memcmp(buf, res, len)) {
- printf("FAIL\nGOT: [%d] %s\nEXP: [%d] %s\n", k, osmo_hexdump_nospc(buf, len), k, osmo_hexdump_nospc(res, len));
+ printf("FAIL:\n");
+ printf("GOT: [%d] %s\n", k, osmo_hexdump_nospc(buf, len));
+ printf("EXP: [%d] %s\n", k, osmo_hexdump_nospc(res, len));
return false;
}
printf("OK\n");