From 756ac0bb1526c8c661ad3ff673cd17c7602ab46e Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sat, 4 Oct 2014 11:29:50 -0600 Subject: test: dm: Support memory leak checking as a core feature Check the state of the malloc() heap before each test is run, so that tests can verify that all is well at the end. Provide helper functions to mark the heap and to check that it returns to its initial state. Signed-off-by: Simon Glass --- test/dm/test-main.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'test/dm/test-main.c') diff --git a/test/dm/test-main.c b/test/dm/test-main.c index 94ce72a..90ca810 100644 --- a/test/dm/test-main.c +++ b/test/dm/test-main.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -88,6 +89,7 @@ int dm_test_main(void) printf("Test: %s\n", test->name); ut_assertok(dm_test_init(dms)); + dms->start = mallinfo(); if (test->flags & DM_TESTF_SCAN_PDATA) ut_assertok(dm_scan_platdata(false)); if (test->flags & DM_TESTF_PROBE_TEST) -- cgit v1.1