summaryrefslogtreecommitdiffstats
path: root/testsuites
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2022-04-28 08:56:59 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2022-04-28 09:16:54 +0200
commit8b18037f203b2b2dfceae4fb46e7eca388f229ad (patch)
tree4d2839fac7b365974647549ae0812b4bbedd4c7a /testsuites
parentsp65/init.c: Add file header and license (diff)
downloadrtems-8b18037f203b2b2dfceae4fb46e7eca388f229ad.tar.bz2
heap: Fix heap statistics with protection enabled
Close #4644.
Diffstat (limited to 'testsuites')
-rw-r--r--testsuites/libtests/malloctest/init.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/testsuites/libtests/malloctest/init.c b/testsuites/libtests/malloctest/init.c
index 7d03a2deab..05d97a27d5 100644
--- a/testsuites/libtests/malloctest/init.c
+++ b/testsuites/libtests/malloctest/init.c
@@ -141,9 +141,13 @@ static void test_heap_default_init(void)
static void test_free( void *addr )
{
+ uint32_t failed_allocs;
+
rtems_test_assert( _Heap_Free( &TestHeap, addr ) );
+ failed_allocs = TestHeap.stats.failed_allocs;
_Heap_Protection_free_all_delayed_blocks( &TestHeap );
+ rtems_test_assert( failed_allocs == TestHeap.stats.failed_allocs );
}
static void test_heap_cases_1(void)