diff --git a/components/bootloader_support/test_apps/bootloader_support/main/test_app_main.c b/components/bootloader_support/test_apps/bootloader_support/main/test_app_main.c index 1027ff129fbc..630aac13bd1b 100644 --- a/components/bootloader_support/test_apps/bootloader_support/main/test_app_main.c +++ b/components/bootloader_support/test_apps/bootloader_support/main/test_app_main.c @@ -7,6 +7,7 @@ #include "unity.h" #include "unity_test_runner.h" #include "esp_heap_caps.h" +#include "esp_ota_ops.h" // Some resources are lazy allocated, e.g. newlib locks, GDMA channel lazy installed by crypto driver @@ -25,12 +26,12 @@ static void check_leak(size_t before_free, size_t after_free, const char *type) void setUp(void) { + // load the partition table before measuring the initial free heap size. + TEST_ASSERT_NOT_EQUAL(NULL, esp_ota_get_running_partition()); before_free_8bit = heap_caps_get_free_size(MALLOC_CAP_8BIT); before_free_32bit = heap_caps_get_free_size(MALLOC_CAP_32BIT); } - - void tearDown(void) { size_t after_free_8bit = heap_caps_get_free_size(MALLOC_CAP_8BIT); diff --git a/components/bootloader_support/test_apps/bootloader_support/main/test_verify_image.c b/components/bootloader_support/test_apps/bootloader_support/main/test_verify_image.c index f3a6a3f60e01..0db667699a74 100644 --- a/components/bootloader_support/test_apps/bootloader_support/main/test_verify_image.c +++ b/components/bootloader_support/test_apps/bootloader_support/main/test_verify_image.c @@ -46,6 +46,8 @@ TEST_CASE("Verify unit test app image", "[bootloader_support][qemu-ignore-c3]") .offset = running->address, .size = running->size, }; + TEST_ASSERT_GREATER_THAN(0, running->address); + TEST_ASSERT_GREATER_THAN(0, running->size); TEST_ASSERT_EQUAL_HEX(ESP_OK, esp_image_verify(ESP_IMAGE_VERIFY, &running_pos, &data)); TEST_ASSERT_NOT_EQUAL(0, data.image_len);