fix(mmap): fix esp32s3 mmap test wrong assertion

This commit is contained in:
Armando 2023-11-07 10:35:04 +08:00
parent 13b649ab95
commit 9a428c4019

View File

@ -368,7 +368,12 @@ TEST_CASE("phys2cache/cache2phys basic checks", "[spi_flash][mmap]")
uint32_t phys = spi_flash_cache2phys(esp_partition_find);
TEST_ASSERT_NOT_EQUAL(SPI_FLASH_CACHE2PHYS_FAIL, phys);
TEST_ASSERT_EQUAL_PTR(esp_partition_find, spi_flash_phys2cache(phys, SPI_FLASH_MMAP_INST));
#if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S2
/**
* Only esp32 and esp32s2 is I or D take up a bus exclusively
*/
TEST_ASSERT_EQUAL_PTR(NULL, spi_flash_phys2cache(phys, SPI_FLASH_MMAP_DATA));
#endif
/* Read the flash @ 'phys' and compare it to the data we get via regular cache access */
spi_flash_read_maybe_encrypted(phys, buf, sizeof(buf));
@ -384,7 +389,12 @@ TEST_CASE("phys2cache/cache2phys basic checks", "[spi_flash][mmap]")
TEST_ASSERT_NOT_EQUAL(SPI_FLASH_CACHE2PHYS_FAIL, phys);
TEST_ASSERT_EQUAL_PTR(&constant_data,
spi_flash_phys2cache(phys, SPI_FLASH_MMAP_DATA));
#if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S2
/**
* Only esp32 and esp32s2 is I or D take up a bus exclusively
*/
TEST_ASSERT_EQUAL_PTR(NULL, spi_flash_phys2cache(phys, SPI_FLASH_MMAP_INST));
#endif
/* Read the flash @ 'phys' and compare it to the data we get via normal cache access */
spi_flash_read_maybe_encrypted(phys, buf, sizeof(constant_data));