From 1bec3908c6c25a0814872ca3c383f5bfe6babbe8 Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 14 Jan 2019 19:31:42 +0100 Subject: LCLS: add GCR comparison helper Change-Id: I9e3b5560a058b976638d03cb819415d237ae9984 --- tests/gsm0808/gsm0808_test.c | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) (limited to 'tests') diff --git a/tests/gsm0808/gsm0808_test.c b/tests/gsm0808/gsm0808_test.c index b3cab502..546a487b 100644 --- a/tests/gsm0808/gsm0808_test.c +++ b/tests/gsm0808/gsm0808_test.c @@ -732,25 +732,10 @@ static void test_enc_dec_lcls() abort(); } - if (lcls_out.gcr->net_len != g.net_len) { - printf("Network ID length parsed wrong: %u != %u\n", lcls_out.gcr->net_len, g.net_len); - abort(); - } - - if (lcls_out.gcr->node != g.node) { - printf("Node ID parsed wrong: 0x%X != 0x%X\n", lcls_out.gcr->node, g.node); - abort(); - } - - if (memcmp(lcls_out.gcr->net, g.net, g.net_len) != 0) { - printf("Network ID parsed wrong: %s\n", osmo_hexdump(lcls_out.gcr->net, lcls_out.gcr->net_len)); - abort(); - } - - if (memcmp(lcls_out.gcr->cr, g.cr, 5) != 0) { - printf("Call ref. ID parsed wrong: %s\n", osmo_hexdump(lcls_out.gcr->cr, 5)); - abort(); - } + if (!osmo_gcr_eq(lcls_out.gcr, lcls_in.gcr)) { + printf("GCR parsed wrong.\n"); + abort(); + } printf("\tdecoded %d bytes: %s\n", rc, rc == len ? "OK" : "FAIL"); msgb_free(msg); -- cgit v1.2.3