From a583063664460b4818995149e3492c2d84c892bb Mon Sep 17 00:00:00 2001 From: Sudeep Mohanty Date: Wed, 15 Nov 2023 09:06:06 +0100 Subject: [PATCH] fix(unity): Fixed memory leaks in unity tests This commit fixes memory leaks in unity tests when the debug option CONFIG_FREERTOS_USE_LIST_DATA_INTEGRITY_CHECK_BYTES is enabled. The commit increases the threshold to 1200 bytes from 1024 bytes. --- .../linux_compatible/linux_freertos/main/Kconfig.projbuild | 2 +- tools/unit-test-app/components/test_utils/Kconfig | 2 +- .../unit-test-app/components/test_utils/include/memory_checks.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/test_apps/linux_compatible/linux_freertos/main/Kconfig.projbuild b/tools/test_apps/linux_compatible/linux_freertos/main/Kconfig.projbuild index eb5770cea7..1b68b3ea6d 100644 --- a/tools/test_apps/linux_compatible/linux_freertos/main/Kconfig.projbuild +++ b/tools/test_apps/linux_compatible/linux_freertos/main/Kconfig.projbuild @@ -18,7 +18,7 @@ menu "IDF unit test" config UNITY_CRITICAL_LEAK_LEVEL_GENERAL int "Critical leak" - default 1024 + default 1200 config UNITY_CRITICAL_LEAK_LEVEL_LWIP int "Critical leak for UT which use LWIP component" diff --git a/tools/unit-test-app/components/test_utils/Kconfig b/tools/unit-test-app/components/test_utils/Kconfig index eb5770cea7..1b68b3ea6d 100644 --- a/tools/unit-test-app/components/test_utils/Kconfig +++ b/tools/unit-test-app/components/test_utils/Kconfig @@ -18,7 +18,7 @@ menu "IDF unit test" config UNITY_CRITICAL_LEAK_LEVEL_GENERAL int "Critical leak" - default 1024 + default 1200 config UNITY_CRITICAL_LEAK_LEVEL_LWIP int "Critical leak for UT which use LWIP component" diff --git a/tools/unit-test-app/components/test_utils/include/memory_checks.h b/tools/unit-test-app/components/test_utils/include/memory_checks.h index 636757e246..2546e1a0a5 100644 --- a/tools/unit-test-app/components/test_utils/include/memory_checks.h +++ b/tools/unit-test-app/components/test_utils/include/memory_checks.h @@ -36,7 +36,7 @@ typedef enum { * @brief Adjust the memory leak thresholds for unit tests. * * Usually, unit tests will check if memory is leaked. Some functionality used by unit tests may unavoidably - * leak memory. This is why there is a default threshold for memory leaks (currently 1024 bytes). + * leak memory. This is why there is a default threshold for memory leaks (currently 1200 bytes). * Within this range, the number of bytes leaked will be visually reported on the terminal, but no test failure will * be triggered. Any memory leak above the default threshold will trigger a unit test failure. * This function allows to adjust that memory leak threshold.