unit-tests: Move the leak related tests from the heap component to test_utils

This commit is contained in:
Guillaume Souchere
2022-09-22 09:36:06 +02:00
parent 82c98c7f48
commit bf18a05a5f
2 changed files with 8 additions and 9 deletions

View File

@@ -4,7 +4,6 @@ set(src_test "test_app_main.c"
"test_corruption_check.c" "test_corruption_check.c"
"test_diram.c" "test_diram.c"
"test_heap_trace.c" "test_heap_trace.c"
"test_leak.c"
"test_malloc_caps.c" "test_malloc_caps.c"
"test_malloc.c" "test_malloc.c"
"test_realloc.c" "test_realloc.c"

View File

@@ -1,7 +1,7 @@
/* /*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
* *
* SPDX-License-Identifier: Unlicense OR CC0-1.0 * SPDX-License-Identifier: Apache-2.0
*/ */
/* /*
Tests for a leak tag Tests for a leak tag
@@ -21,23 +21,23 @@ static char* check_calloc(int size)
return arr; return arr;
} }
TEST_CASE("Check for leaks (no leak)", "[heap]") TEST_CASE("Check for leaks (no leak)", "[test_utils]")
{ {
char *arr = check_calloc(1000); char *arr = check_calloc(1000);
free(arr); free(arr);
} }
TEST_CASE("Check for leaks (leak)", "[heap][ignore]") TEST_CASE("Check for leaks (leak)", "[test_utils][ignore]")
{ {
check_calloc(1000); check_calloc(1000);
} }
TEST_CASE("Not check for leaks", "[heap][leaks]") TEST_CASE("Not check for leaks", "[test_utils][leaks]")
{ {
check_calloc(1000); check_calloc(1000);
} }
TEST_CASE("Set a leak level = 7016", "[heap][leaks=7016]") TEST_CASE("Set a leak level = 7016", "[test_utils][leaks=7016]")
{ {
check_calloc(7000); check_calloc(7000);
} }
@@ -47,9 +47,9 @@ static void test_fn(void)
check_calloc(1000); check_calloc(1000);
} }
TEST_CASE_MULTIPLE_STAGES("Not check for leaks in MULTIPLE_STAGES mode", "[heap][leaks]", test_fn, test_fn, test_fn); TEST_CASE_MULTIPLE_STAGES("Not check for leaks in MULTIPLE_STAGES mode", "[test_utils][leaks]", test_fn, test_fn, test_fn);
TEST_CASE_MULTIPLE_STAGES("Check for leaks in MULTIPLE_STAGES mode (leak)", "[heap][ignore]", test_fn, test_fn, test_fn); TEST_CASE_MULTIPLE_STAGES("Check for leaks in MULTIPLE_STAGES mode (leak)", "[test_utils][ignore]", test_fn, test_fn, test_fn);
static void test_fn2(void) static void test_fn2(void)
{ {
@@ -62,4 +62,4 @@ static void test_fn3(void)
check_calloc(1000); check_calloc(1000);
} }
TEST_CASE_MULTIPLE_STAGES("Check for leaks in MULTIPLE_STAGES mode (manual reset)", "[heap][leaks][reset=SW_CPU_RESET, SW_CPU_RESET]", test_fn2, test_fn2, test_fn3); TEST_CASE_MULTIPLE_STAGES("Check for leaks in MULTIPLE_STAGES mode (manual reset)", "[test_utils][leaks][reset=SW_CPU_RESET, SW_CPU_RESET]", test_fn2, test_fn2, test_fn3);