partition: use esp_partition_munmap instead of spi_flash_munmap

This commit is contained in:
Armando
2022-11-07 19:31:29 +08:00
committed by Rocha Euripedes
parent cc7d9b4b7c
commit f643b95118
3 changed files with 8 additions and 9 deletions

View File

@@ -23,7 +23,7 @@
#include "test_mqtt_client_broker.h"
#include "test_mqtt_connection.h"
#include "esp_mac.h"
#include "spi_flash_mmap.h"
#include "esp_partition.h"
static void test_leak_setup(const char * file, long line)
{
@@ -59,10 +59,10 @@ TEST_CASE("mqtt init and deinit", "[mqtt][leaks=0]")
static const char* this_bin_addr(void)
{
spi_flash_mmap_handle_t out_handle;
esp_partition_mmap_handle_t out_handle;
const void *binary_address;
const esp_partition_t* partition = esp_ota_get_running_partition();
esp_partition_mmap(partition, 0, partition->size, SPI_FLASH_MMAP_DATA, &binary_address, &out_handle);
esp_partition_mmap(partition, 0, partition->size, ESP_PARTITION_MMAP_DATA, &binary_address, &out_handle);
return binary_address;
}

View File

@@ -17,7 +17,7 @@
#include "test_mqtt5_client_broker.h"
#include "test_mqtt_connection.h"
#include "esp_mac.h"
#include "spi_flash_mmap.h"
#include "esp_partition.h"
static esp_mqtt5_user_property_item_t user_property_arr[3] = {
{"board", "esp32"},
@@ -89,10 +89,10 @@ TEST_CASE("mqtt5 init and deinit", "[mqtt5][leaks=0]")
static const char* this_bin_addr(void)
{
spi_flash_mmap_handle_t out_handle;
esp_partition_mmap_handle_t out_handle;
const void *binary_address;
const esp_partition_t* partition = esp_ota_get_running_partition();
esp_partition_mmap(partition, 0, partition->size, SPI_FLASH_MMAP_DATA, &binary_address, &out_handle);
esp_partition_mmap(partition, 0, partition->size, ESP_PARTITION_MMAP_DATA, &binary_address, &out_handle);
return binary_address;
}