mirror of
https://github.com/espressif/esp-idf
synced 2025-03-10 01:29:21 -04:00
unit-tests: Move the leak related tests from the heap component to test_utils
This commit is contained in:
parent
82c98c7f48
commit
bf18a05a5f
@ -4,7 +4,6 @@ set(src_test "test_app_main.c"
|
||||
"test_corruption_check.c"
|
||||
"test_diram.c"
|
||||
"test_heap_trace.c"
|
||||
"test_leak.c"
|
||||
"test_malloc_caps.c"
|
||||
"test_malloc.c"
|
||||
"test_realloc.c"
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* 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
|
||||
@ -21,23 +21,23 @@ static char* check_calloc(int size)
|
||||
return arr;
|
||||
}
|
||||
|
||||
TEST_CASE("Check for leaks (no leak)", "[heap]")
|
||||
TEST_CASE("Check for leaks (no leak)", "[test_utils]")
|
||||
{
|
||||
char *arr = check_calloc(1000);
|
||||
free(arr);
|
||||
}
|
||||
|
||||
TEST_CASE("Check for leaks (leak)", "[heap][ignore]")
|
||||
TEST_CASE("Check for leaks (leak)", "[test_utils][ignore]")
|
||||
{
|
||||
check_calloc(1000);
|
||||
}
|
||||
|
||||
TEST_CASE("Not check for leaks", "[heap][leaks]")
|
||||
TEST_CASE("Not check for leaks", "[test_utils][leaks]")
|
||||
{
|
||||
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);
|
||||
}
|
||||
@ -47,9 +47,9 @@ static void test_fn(void)
|
||||
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)
|
||||
{
|
||||
@ -62,4 +62,4 @@ static void test_fn3(void)
|
||||
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);
|
Loading…
x
Reference in New Issue
Block a user