From cf6ee64423480137d15f6277144c1460756947dc Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Thu, 20 Dec 2018 05:23:00 +0700 Subject: tests/gsm0808: use new msgb comparison API Since I3bc95f2f5ab6e3f4b502647fb3e0aaaf1f7c4cf5, we have some helpers to compare certain msgb layer to a given buffer. Let's change 'VERIFY' macro to use msgb_eq_l3_data_print(). Change-Id: Ib6be778236eff8f2153f3113f9379ecfbec9052b --- tests/gsm0808/gsm0808_test.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'tests/gsm0808') diff --git a/tests/gsm0808/gsm0808_test.c b/tests/gsm0808/gsm0808_test.c index 46169ea4..ebdfc29c 100644 --- a/tests/gsm0808/gsm0808_test.c +++ b/tests/gsm0808/gsm0808_test.c @@ -39,18 +39,10 @@ OSMO_ASSERT(rc_enc == msg->len); \ } while(0) -#define VERIFY(msg, data, len) \ - if (msgb_l3len(msg) != len) { \ - printf("%s:%d Length don't match: %d vs. %d. %s\n", \ - __func__, __LINE__, msgb_l3len(msg), (int) len, \ - osmo_hexdump(msg->l3h, msgb_l3len(msg))); \ - abort(); \ - } else if (memcmp(msg->l3h, data, len) != 0) { \ - printf("%s:%d didn't match: got: %s\n", \ - __func__, __LINE__, \ - osmo_hexdump(msg->l3h, msgb_l3len(msg))); \ - abort(); \ - } +#define VERIFY(msg, data, data_len) do { \ + if (!msgb_eq_l3_data_print(msg, data, data_len)) \ + abort(); \ + } while(0) /* Setup a fake codec list for testing */ static void setup_codec_list(struct gsm0808_speech_codec_list *scl) -- cgit v1.2.3