feature (unity): added memory leak check API, integrated it into cxx tests

This commit is contained in:
Jakob Hasse
2022-03-31 18:16:19 +08:00
parent f3e8a17285
commit 905f5c3d41
18 changed files with 203 additions and 25 deletions

View File

@@ -5,7 +5,7 @@
*/
#include <stdexcept>
#include "unity.h"
#include "memory_checks.h"
#include "unity_test_utils.h"
/* Note: When first exception (in system) is thrown this test produces memory leaks report (~300 bytes):
- 8 bytes are allocated by __cxa_get_globals() to keep __cxa_eh_globals
@@ -25,12 +25,12 @@
extern "C" void setUp()
{
test_utils_record_free_mem();
unity_utils_record_free_mem();
}
extern "C" void tearDown()
{
test_utils_finish_and_evaluate_leaks(LEAKS, LEAKS);
unity_utils_evaluate_leaks_direct(LEAKS);
}
TEST_CASE("c++ exceptions work", "[cxx] [exceptions]")