mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
heap: Fix heap metadata test to account for background memory allocations
This commit is contained in:
parent
fb30315d01
commit
d444469cae
@ -103,8 +103,11 @@ TEST_CASE("heap_caps metadata test", "[heap]")
|
|||||||
|
|
||||||
free(b);
|
free(b);
|
||||||
heap_caps_get_info(&after, MALLOC_CAP_8BIT);
|
heap_caps_get_info(&after, MALLOC_CAP_8BIT);
|
||||||
TEST_ASSERT_EQUAL(after.total_free_bytes, original.total_free_bytes);
|
/* Allow some leeway here, because LWIP sometimes allocates up to 144 bytes in the background
|
||||||
TEST_ASSERT_EQUAL(after.largest_free_block, original.largest_free_block);
|
as part of timer management.
|
||||||
|
*/
|
||||||
|
TEST_ASSERT_INT32_WITHIN(200, after.total_free_bytes, original.total_free_bytes);
|
||||||
|
TEST_ASSERT_INT32_WITHIN(200, after.largest_free_block, original.largest_free_block);
|
||||||
TEST_ASSERT(after.minimum_free_bytes < original.total_free_bytes);
|
TEST_ASSERT(after.minimum_free_bytes < original.total_free_bytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user