mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-10 12:53:29 +00:00
heap trace standalone: Fix initialization of the unused linked list, update tests
- Call TAILQ_INSERT_TAIL in linked_list_setup to add unused records from the tail of the list - Fix test "heap trace leak check" to expect that after a free, the record is zeroed instead of checking that the whole list of records is moved by one index in the array. - Use esp_rom_printf() under lock instead of printf() since it does not rely on interrupts.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
*/
|
||||
@@ -66,9 +66,9 @@ TEST_CASE("heap trace leak check", "[heap-trace]")
|
||||
heap_trace_get(0, &trace_b);
|
||||
TEST_ASSERT_EQUAL_PTR(b, trace_b.address);
|
||||
|
||||
/* buffer deletes trace_a when freed,
|
||||
so trace_b at head of buffer */
|
||||
TEST_ASSERT_EQUAL_PTR(recs[0].address, trace_b.address);
|
||||
/* trace_a freed and placed back to unused list,
|
||||
so recs[0].address is 0*/
|
||||
TEST_ASSERT_EQUAL_PTR(recs[0].address, 0x00);
|
||||
|
||||
heap_trace_stop();
|
||||
}
|
||||
|
Reference in New Issue
Block a user