@@ -48,12 +48,6 @@ __attribute__((unused)) static const uint32_t mmu_op_fail_seq[8] = {[0 ... 7] =
4848 } while (0)
4949#endif
5050
51- #if SOC_TEE_FLASH_OP_FAIL_FAULT
52- #define CHECK_FLASH_OP_FAIL (err ) TEST_ESP_ERR(ESP_FAIL, err)
53- #else
54- #define CHECK_FLASH_OP_FAIL (err ) do { (void)(err); esp_restart(); } while (0)
55- #endif
56-
5751static const char * TAG = "test_esp_tee_flash_prot" ;
5852
5953static void set_boot_count_in_nvs (uint8_t boot_count )
@@ -146,24 +140,21 @@ static void test_esp_partition_api_r(const esp_partition_t *part)
146140 TEST_ASSERT_NOT_NULL (part );
147141 uint8_t buf_r [128 ];
148142 memset (buf_r , 0x00 , sizeof (buf_r ));
149- esp_err_t err = esp_partition_read (part , 0x00 , buf_r , sizeof (buf_r ));
150- CHECK_FLASH_OP_FAIL (err );
143+ esp_partition_read (part , 0x00 , buf_r , sizeof (buf_r ));
151144}
152145
153146static void test_esp_partition_api_w (const esp_partition_t * part )
154147{
155148 TEST_ASSERT_NOT_NULL (part );
156149 uint8_t buf_w [128 ];
157150 memset (buf_w , 0xA5 , sizeof (buf_w ));
158- esp_err_t err = esp_partition_write (part , 0x00 , buf_w , sizeof (buf_w ));
159- CHECK_FLASH_OP_FAIL (err );
151+ esp_partition_write (part , 0x00 , buf_w , sizeof (buf_w ));
160152}
161153
162154static void test_esp_partition_api_e (const esp_partition_t * part )
163155{
164156 TEST_ASSERT_NOT_NULL (part );
165- esp_err_t err = esp_partition_erase_range (part , 0x00 , SPI_FLASH_SEC_SIZE );
166- CHECK_FLASH_OP_FAIL (err );
157+ esp_partition_erase_range (part , 0x00 , SPI_FLASH_SEC_SIZE );
167158}
168159
169160static void test_esp_partition_api (void )
@@ -267,22 +258,19 @@ static void test_esp_flash_api_r(uint32_t paddr)
267258{
268259 uint8_t buf_r [128 ];
269260 memset (buf_r , 0x00 , sizeof (buf_r ));
270- esp_err_t err = esp_flash_read (NULL , buf_r , paddr , sizeof (buf_r ));
271- CHECK_FLASH_OP_FAIL (err );
261+ esp_flash_read (NULL , buf_r , paddr , sizeof (buf_r ));
272262}
273263
274264static void test_esp_flash_api_w (uint32_t paddr )
275265{
276266 uint8_t buf_w [128 ];
277267 memset (buf_w , 0xA5 , sizeof (buf_w ));
278- esp_err_t err = esp_flash_write (NULL , buf_w , paddr , sizeof (buf_w ));
279- CHECK_FLASH_OP_FAIL (err );
268+ esp_flash_write (NULL , buf_w , paddr , sizeof (buf_w ));
280269}
281270
282271static void test_esp_flash_api_e (uint32_t paddr )
283272{
284- esp_err_t err = esp_flash_erase_region (NULL , paddr , SPI_FLASH_SEC_SIZE );
285- CHECK_FLASH_OP_FAIL (err );
273+ esp_flash_erase_region (NULL , paddr , SPI_FLASH_SEC_SIZE );
286274}
287275
288276static void test_esp_flash_api (void )
0 commit comments