From 5388c0c2e7b595ef644b5445384bc09e0897a6cd Mon Sep 17 00:00:00 2001 From: Harshit Malpani Date: Mon, 6 Feb 2023 14:37:53 +0530 Subject: [PATCH] app_update: Remove `Wno-format` compile option for test app --- components/app_update/test_apps/main/CMakeLists.txt | 2 -- .../app_update/test_apps/main/test_switch_ota.c | 11 ++++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/components/app_update/test_apps/main/CMakeLists.txt b/components/app_update/test_apps/main/CMakeLists.txt index a853e80a3d..0011e70856 100644 --- a/components/app_update/test_apps/main/CMakeLists.txt +++ b/components/app_update/test_apps/main/CMakeLists.txt @@ -2,5 +2,3 @@ idf_component_register(SRC_DIRS "." PRIV_INCLUDE_DIRS "." PRIV_REQUIRES cmock test_utils app_update bootloader_support nvs_flash driver spi_flash WHOLE_ARCHIVE) - -target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format") diff --git a/components/app_update/test_apps/main/test_switch_ota.c b/components/app_update/test_apps/main/test_switch_ota.c index 5d524a8af9..503d671c3a 100644 --- a/components/app_update/test_apps/main/test_switch_ota.c +++ b/components/app_update/test_apps/main/test_switch_ota.c @@ -10,6 +10,7 @@ #include #include #include "string.h" +#include #include "sdkconfig.h" #include "esp_rom_spiflash.h" @@ -126,7 +127,7 @@ static const esp_partition_t * get_next_update_partition(void) { const esp_partition_t *update_partition = esp_ota_get_next_update_partition(NULL); TEST_ASSERT_NOT_EQUAL(NULL, update_partition); - ESP_LOGI(TAG, "Writing to partition subtype %d at offset 0x%x", update_partition->subtype, update_partition->address); + ESP_LOGI(TAG, "Writing to partition subtype %d at offset 0x%"PRIx32, update_partition->subtype, update_partition->address); return update_partition; } @@ -139,7 +140,7 @@ static void copy_current_app_to_next_part(const esp_partition_t *cur_app_partiti { esp_ota_get_next_update_partition(NULL); TEST_ASSERT_NOT_EQUAL(NULL, next_app_partition); - ESP_LOGI(TAG, "Writing to partition subtype %d at offset 0x%x", next_app_partition->subtype, next_app_partition->address); + ESP_LOGI(TAG, "Writing to partition subtype %d at offset 0x%"PRIx32, next_app_partition->subtype, next_app_partition->address); esp_ota_handle_t update_handle = 0; TEST_ESP_OK(esp_ota_begin(next_app_partition, OTA_SIZE_UNKNOWN, &update_handle)); @@ -159,7 +160,7 @@ static void copy_current_app_to_next_part_with_offset(const esp_partition_t *cur { esp_ota_get_next_update_partition(NULL); TEST_ASSERT_NOT_EQUAL(NULL, next_app_partition); - ESP_LOGI(TAG, "Writing to partition subtype %d at offset 0x%x", next_app_partition->subtype, next_app_partition->address); + ESP_LOGI(TAG, "Writing to partition subtype %d at offset 0x%"PRIx32, next_app_partition->subtype, next_app_partition->address); esp_ota_handle_t update_handle = 0; TEST_ESP_OK(esp_ota_begin(next_app_partition, OTA_SIZE_UNKNOWN, &update_handle)); @@ -216,9 +217,9 @@ static const esp_partition_t* get_running_firmware(void) { const esp_partition_t *configured = esp_ota_get_boot_partition(); const esp_partition_t *running = esp_ota_get_running_partition(); - ESP_LOGI(TAG, "Running partition type %d subtype %d (offset 0x%08x)", + ESP_LOGI(TAG, "Running partition type %d subtype %d (offset 0x%08"PRIx32")", running->type, running->subtype, running->address); - ESP_LOGI(TAG, "Configured partition type %d subtype %d (offset 0x%08x)", + ESP_LOGI(TAG, "Configured partition type %d subtype %d (offset 0x%08"PRIx32")", configured->type, configured->subtype, configured->address); TEST_ASSERT_NOT_EQUAL(NULL, configured); TEST_ASSERT_NOT_EQUAL(NULL, running);