summaryrefslogtreecommitdiff
path: root/test/dm/test-main.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2014-10-04 17:29:50 (GMT)
committerSimon Glass <sjg@chromium.org>2014-10-24 01:29:53 (GMT)
commit756ac0bb1526c8c661ad3ff673cd17c7602ab46e (patch)
tree0c72b1317e1d9be6f0ab0ee353e8c9ac878e5037 /test/dm/test-main.c
parentd44f597b12b8f8099c3c52c3eb09540966cafe79 (diff)
downloadu-boot-756ac0bb1526c8c661ad3ff673cd17c7602ab46e.tar.xz
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 <sjg@chromium.org>
Diffstat (limited to 'test/dm/test-main.c')
-rw-r--r--test/dm/test-main.c2
1 files changed, 2 insertions, 0 deletions
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 <common.h>
#include <dm.h>
#include <errno.h>
+#include <malloc.h>
#include <dm/test.h>
#include <dm/root.h>
#include <dm/uclass-internal.h>
@@ -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)