From b58e0061e0c6ca44e445b7191d9437fd7609f315 Mon Sep 17 00:00:00 2001 From: Erik Ekman Date: Tue, 23 Jun 2020 20:47:05 +0200 Subject: [PATCH] unit: Improve message when the mem heap has usage Show "mem heap still has 216 bytes allocated" instead of "Assertion 'lwip_stats.mem.used == 0' failed" --- test/unit/lwip_unittests.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/unit/lwip_unittests.c b/test/unit/lwip_unittests.c index 3cb4a885..5b8d523f 100644 --- a/test/unit/lwip_unittests.c +++ b/test/unit/lwip_unittests.c @@ -50,7 +50,8 @@ void lwip_check_ensure_no_alloc(unsigned int skip) unsigned int mask; if (!(skip & SKIP_HEAP)) { - fail_unless(lwip_stats.mem.used == 0); + fail_unless(lwip_stats.mem.used == 0, + "mem heap still has %d bytes allocated", lwip_stats.mem.used); } for (i = 0, mask = 1; i < MEMP_MAX; i++, mask <<= 1) { if (!(skip & mask)) {