aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/tests
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2012-01-18 17:20:23 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2012-01-18 17:20:23 +0100
commitbe53012f9c14b1bf27b16f4fa2d0f58f8f0393ca (patch)
tree5205f3a92b6106a294c38944ffb4b792cf78ecd2 /openbsc/tests
parent0354a80357431795b312deeb82a6f685fbc5ceee (diff)
nat: Print the sizes and the offending data in case of a failure
Diffstat (limited to 'openbsc/tests')
-rw-r--r--openbsc/tests/bsc-nat/bsc_nat_test.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/openbsc/tests/bsc-nat/bsc_nat_test.c b/openbsc/tests/bsc-nat/bsc_nat_test.c
index 65ff4f65a..ab97db1ee 100644
--- a/openbsc/tests/bsc-nat/bsc_nat_test.c
+++ b/openbsc/tests/bsc-nat/bsc_nat_test.c
@@ -267,7 +267,11 @@ static void copy_to_msg(struct msgb *msg, const uint8_t *data, unsigned int leng
static void verify_msg(struct msgb *out, const uint8_t *ref, int ref_len)
{
if (out->len != ref_len) {
- printf("FAIL: The size should match.\n");
+ printf("FAIL: The size should match: %d vs. %d\n",
+ out->len, ref_len);
+ printf("%s\n", osmo_hexdump(out->data, out->len));
+ printf("Wanted\n");
+ printf("%s\n", osmo_hexdump(ref, ref_len));
abort();
}