Change in libosmocore[master]: tests/gsm0808: use new msgb comparison API

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Max gerrit-no-reply at lists.osmocom.org
Fri Dec 21 18:22:52 UTC 2018


Max has submitted this change and it was merged. ( https://gerrit.osmocom.org/12271 )

Change subject: tests/gsm0808: use new msgb comparison API
......................................................................

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
---
M tests/gsm0808/gsm0808_test.c
1 file changed, 4 insertions(+), 12 deletions(-)

Approvals:
  Max: Looks good to me, approved
  Pau Espin Pedrol: Looks good to me, but someone else must approve
  Stefan Sperling: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/tests/gsm0808/gsm0808_test.c b/tests/gsm0808/gsm0808_test.c
index 46169ea..ebdfc29 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)

-- 
To view, visit https://gerrit.osmocom.org/12271
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib6be778236eff8f2153f3113f9379ecfbec9052b
Gerrit-Change-Number: 12271
Gerrit-PatchSet: 5
Gerrit-Owner: Max <msuraev at sysmocom.de>
Gerrit-Assignee: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Stefan Sperling <stsp at stsp.name>
Gerrit-Reviewer: Vadim Yanitskiy <axilirator at gmail.com>
Gerrit-CC: fixeria <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181221/ca4af9ac/attachment.htm>


More information about the gerrit-log mailing list