nat: Print the sizes and the offending data in case of a failure

This commit is contained in:
Holger Hans Peter Freyther 2012-01-18 17:20:23 +01:00
parent 0354a80357
commit be53012f9c
1 changed files with 5 additions and 1 deletions

View File

@ -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();
}