From f418a998a93aae2bf0822c931afd9978ec854f29 Mon Sep 17 00:00:00 2001 From: Jiang Guang Ming Date: Mon, 17 Jul 2023 10:54:17 +0800 Subject: [PATCH] fix(mbedtls): sha test will fail when run twice --- components/mbedtls/test/test_sha.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/mbedtls/test/test_sha.c b/components/mbedtls/test/test_sha.c index a40c70ee3d..be800a0993 100644 --- a/components/mbedtls/test/test_sha.c +++ b/components/mbedtls/test/test_sha.c @@ -128,6 +128,9 @@ TEST_CASE("Test esp_sha() function with long input", "[hw_crypto]") TEST_ASSERT_EQUAL(0, r); #endif + /* munmap() 1MB of flash when the usge of memory-mapped ptr is over */ + spi_flash_munmap(handle); + TEST_ASSERT_EQUAL_MEMORY_MESSAGE(sha1_espsha, sha1_mbedtls, sizeof(sha1_espsha), "SHA1 results should match"); TEST_ASSERT_EQUAL_MEMORY_MESSAGE(sha256_espsha, sha256_mbedtls, sizeof(sha256_espsha), "SHA256 results should match");