tests: Make leak check work again by setting default visibility for malloc/free
authorKristian Høgsberg <krh@bitplanet.net>
Fri, 13 Apr 2012 14:13:49 +0000 (10:13 -0400)
committerKristian Høgsberg <krh@bitplanet.net>
Fri, 13 Apr 2012 14:13:49 +0000 (10:13 -0400)
We compile the test cases with -fvisibility=hidden which makes
our malloc/free wrappers fail to override system malloc/free.

tests/test-runner.c

index 188f4cc..0bafc58 100644 (file)
@@ -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--;