diff options
author | Vadim Yanitskiy <axilirator@gmail.com> | 2018-12-20 05:23:00 +0700 |
---|---|---|
committer | Max <msuraev@sysmocom.de> | 2018-12-21 18:22:52 +0000 |
commit | cf6ee64423480137d15f6277144c1460756947dc (patch) | |
tree | e4d3507cda6b3f17fc2c1da37b0a7d551a06a7e8 | |
parent | 10db2817e5ce76eebd61dd6b607a6dfad57fa417 (diff) |
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
-rw-r--r-- | tests/gsm0808/gsm0808_test.c | 16 |
1 files changed, 4 insertions, 12 deletions
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) |