aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test-runner.c
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2012-04-13 10:13:49 -0400
committerKristian Høgsberg <krh@bitplanet.net>2012-04-13 10:13:49 -0400
commitb68b5e9e0cfb668dd34843656664a01bd304956c (patch)
treed8bd8210f9d50c84919c0eb21c9a066ba1ab55ef /tests/test-runner.c
parenttests: Fix warning in memory leak assert (diff)
downloadwayland-b68b5e9e0cfb668dd34843656664a01bd304956c.tar
wayland-b68b5e9e0cfb668dd34843656664a01bd304956c.tar.gz
wayland-b68b5e9e0cfb668dd34843656664a01bd304956c.tar.bz2
wayland-b68b5e9e0cfb668dd34843656664a01bd304956c.tar.lz
wayland-b68b5e9e0cfb668dd34843656664a01bd304956c.tar.xz
wayland-b68b5e9e0cfb668dd34843656664a01bd304956c.tar.zst
wayland-b68b5e9e0cfb668dd34843656664a01bd304956c.zip
tests: Make leak check work again by setting default visibility for malloc/free
We compile the test cases with -fvisibility=hidden which makes our malloc/free wrappers fail to override system malloc/free.
Diffstat (limited to 'tests/test-runner.c')
-rw-r--r--tests/test-runner.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/test-runner.c b/tests/test-runner.c
index 188f4cc..0bafc58 100644
--- a/tests/test-runner.c
+++ b/tests/test-runner.c
@@ -38,13 +38,15 @@ static void (*sys_free)(void*);
extern const struct test __start_test_section, __stop_test_section;
-void* malloc(size_t size)
+__attribute__ ((visibility("default"))) void *
+malloc(size_t size)
{
num_alloc++;
return sys_malloc(size);
}
-void free(void* mem)
+__attribute__ ((visibility("default"))) void
+free(void* mem)
{
if (mem != NULL)
num_alloc--;