Thread (3 messages) 3 messages, 1 author, 2015-08-21
DORMANTno replies

[PATCH BlueZ 3/3] shared/tester: Add valgrind support

From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Date: 2015-08-21 13:51:43
Subsystem: the rest · Maintainer: Linus Torvalds

From: Luiz Augusto von Dentz <redacted>

This add a call to VALGRIND_DO_ADDED_LEAK_CHECK at the end of each test.
---
 src/shared/tester.c | 8 ++++++++
 1 file changed, 8 insertions(+)
diff --git a/src/shared/tester.c b/src/shared/tester.c
index 30857e0..c3120fb 100644
--- a/src/shared/tester.c
+++ b/src/shared/tester.c
@@ -35,6 +35,10 @@
 
 #include <glib.h>
 
+#ifdef HAVE_VALGRIND_MEMCHECK_H
+#include <valgrind/memcheck.h>
+#endif
+
 #include "src/shared/util.h"
 #include "src/shared/tester.h"
 
@@ -339,6 +343,10 @@ static gboolean teardown_callback(gpointer user_data)
 	print_progress(test->name, COLOR_MAGENTA, "teardown");
 	test->teardown_func(test->test_data);
 
+#ifdef HAVE_VALGRIND_MEMCHECK_H
+	VALGRIND_DO_ADDED_LEAK_CHECK;
+#endif
+
 	return FALSE;
 }
 
-- 
2.4.3
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help