From 5ec0cf5475a7b31efa3b122f53e6c2a0e1908c20 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 15 Jan 2019 16:37:09 +0100 Subject: LCLS: add string dump helpers Add functions to dump LCLS (without GCR) and GCR. Dumping entire struct results in inconveniently long string hence the separate functions. Both use talloc functions so they expect caller to take care of providing proper allocation context and freeing memory. Change-Id: Ic3609224c8f3282d667e75f68bc20327e36eb9e6 --- tests/gsm0808/gsm0808_test.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tests/gsm0808/gsm0808_test.c') diff --git a/tests/gsm0808/gsm0808_test.c b/tests/gsm0808/gsm0808_test.c index 65fef53a..af90d00c 100644 --- a/tests/gsm0808/gsm0808_test.c +++ b/tests/gsm0808/gsm0808_test.c @@ -760,11 +760,12 @@ static void test_enc_dec_lcls() } if (!osmo_gcr_eq(&lcls_out->gcr, &lcls_in.gcr)) { - printf("GCR parsed wrong.\n"); + printf("GCR parsed wrong:\n\t%s\n\t%s\n", osmo_gcr_dump(lcls_out), osmo_gcr_dump(&lcls_in)); abort(); } - printf("\tdecoded %d bytes: %s\n", rc, rc == len ? "OK" : "FAIL"); + printf("\tdecoded %d bytes: %s:\n%s\n", rc, rc == len ? "OK" : "FAIL", osmo_lcls_dump(lcls_out)); + printf("\t%s\n", osmo_gcr_dump(lcls_out)); msgb_free(msg); } -- cgit v1.2.3