@@ -49,12 +49,6 @@ __attribute__((unused)) static const uint32_t mmu_op_fail_seq[8] = {[0 ... 7] =
4949 } while (0)
5050#endif
5151
52- #if SOC_TEE_FLASH_OP_FAIL_FAULT
53- #define CHECK_FLASH_OP_FAIL (err ) TEST_ESP_ERR(ESP_FAIL, err)
54- #else
55- #define CHECK_FLASH_OP_FAIL (err ) do { (void)(err); esp_restart(); } while (0)
56- #endif
57-
5852static const char * TAG = "test_esp_tee_flash_prot" ;
5953
6054static void set_boot_count_in_nvs (uint8_t boot_count )
@@ -147,24 +141,21 @@ static void test_esp_partition_api_r(const esp_partition_t *part)
147141 TEST_ASSERT_NOT_NULL (part );
148142 uint8_t buf_r [128 ];
149143 memset (buf_r , 0x00 , sizeof (buf_r ));
150- esp_err_t err = esp_partition_read (part , 0x00 , buf_r , sizeof (buf_r ));
151- CHECK_FLASH_OP_FAIL (err );
144+ esp_partition_read (part , 0x00 , buf_r , sizeof (buf_r ));
152145}
153146
154147static void test_esp_partition_api_w (const esp_partition_t * part )
155148{
156149 TEST_ASSERT_NOT_NULL (part );
157150 uint8_t buf_w [128 ];
158151 memset (buf_w , 0xA5 , sizeof (buf_w ));
159- esp_err_t err = esp_partition_write (part , 0x00 , buf_w , sizeof (buf_w ));
160- CHECK_FLASH_OP_FAIL (err );
152+ esp_partition_write (part , 0x00 , buf_w , sizeof (buf_w ));
161153}
162154
163155static void test_esp_partition_api_e (const esp_partition_t * part )
164156{
165157 TEST_ASSERT_NOT_NULL (part );
166- esp_err_t err = esp_partition_erase_range (part , 0x00 , SPI_FLASH_SEC_SIZE );
167- CHECK_FLASH_OP_FAIL (err );
158+ esp_partition_erase_range (part , 0x00 , SPI_FLASH_SEC_SIZE );
168159}
169160
170161static void test_esp_partition_api (void )
@@ -269,22 +260,19 @@ static void test_esp_flash_api_r(uint32_t paddr)
269260{
270261 uint8_t buf_r [128 ];
271262 memset (buf_r , 0x00 , sizeof (buf_r ));
272- esp_err_t err = esp_flash_read (NULL , buf_r , paddr , sizeof (buf_r ));
273- CHECK_FLASH_OP_FAIL (err );
263+ esp_flash_read (NULL , buf_r , paddr , sizeof (buf_r ));
274264}
275265
276266static void test_esp_flash_api_w (uint32_t paddr )
277267{
278268 uint8_t buf_w [128 ];
279269 memset (buf_w , 0xA5 , sizeof (buf_w ));
280- esp_err_t err = esp_flash_write (NULL , buf_w , paddr , sizeof (buf_w ));
281- CHECK_FLASH_OP_FAIL (err );
270+ esp_flash_write (NULL , buf_w , paddr , sizeof (buf_w ));
282271}
283272
284273static void test_esp_flash_api_e (uint32_t paddr )
285274{
286- esp_err_t err = esp_flash_erase_region (NULL , paddr , SPI_FLASH_SEC_SIZE );
287- CHECK_FLASH_OP_FAIL (err );
275+ esp_flash_erase_region (NULL , paddr , SPI_FLASH_SEC_SIZE );
288276}
289277
290278static void test_esp_flash_api (void )
0 commit comments