aboutsummaryrefslogtreecommitdiff
path: root/libctf/testsuite/libctf-regression/open-error-free.c
diff options
context:
space:
mode:
Diffstat (limited to 'libctf/testsuite/libctf-regression/open-error-free.c')
-rw-r--r--libctf/testsuite/libctf-regression/open-error-free.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/libctf/testsuite/libctf-regression/open-error-free.c b/libctf/testsuite/libctf-regression/open-error-free.c
index 5e48744..edc5f34 100644
--- a/libctf/testsuite/libctf-regression/open-error-free.c
+++ b/libctf/testsuite/libctf-regression/open-error-free.c
@@ -1,6 +1,7 @@
/* Make sure that, on error, an opened dict is properly freed. */
#define _GNU_SOURCE 1
+#include "config.h"
#include <dlfcn.h>
#include <stdio.h>
#include <stdlib.h>
@@ -8,6 +9,10 @@
#include <ctf-api.h>
#include <ctf.h>
+#ifdef HAVE_VALGRIND_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
+
static unsigned long long malloc_count;
static unsigned long long free_count;
@@ -111,6 +116,14 @@ int main (void)
ctf_next_t *it = NULL;
unsigned long long frozen_malloc_count, frozen_free_count;
+#ifdef HAVE_VALGRIND_VALGRIND_H
+ if (RUNNING_ON_VALGRIND)
+ {
+ printf ("UNSUPPORTED: valgrind interferes with malloc counting\n");
+ return 0;
+ }
+#endif
+
if ((fp = ctf_create (&err)) == NULL)
goto open_err;