mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
spi_flash: add test case for esp_flash_erase_region with 0 size
This commit is contained in:
parent
8e6700c156
commit
118fafef07
@ -615,6 +615,13 @@ void test_erase_large_region(const esp_partition_t *part)
|
||||
TEST_ASSERT_EQUAL(ESP_OK, esp_flash_read(chip, &readback, part->address, 4));
|
||||
TEST_ASSERT_EQUAL_HEX32(0, readback & (~written_data));
|
||||
|
||||
/* Erase zero bytes, check that nothing got erased */
|
||||
TEST_ASSERT_EQUAL(ESP_OK, esp_flash_erase_region(chip, part->address, 0));
|
||||
TEST_ASSERT_EQUAL(ESP_OK, esp_flash_read(chip, &readback, part->address + part->size - 5, 4));
|
||||
TEST_ASSERT_EQUAL_HEX32(0, readback & (~written_data));
|
||||
TEST_ASSERT_EQUAL(ESP_OK, esp_flash_read(chip, &readback, part->address, 4));
|
||||
TEST_ASSERT_EQUAL_HEX32(0, readback & (~written_data));
|
||||
|
||||
/* Erase whole region */
|
||||
TEST_ASSERT_EQUAL(ESP_OK, esp_flash_erase_region(chip, part->address, part->size));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user