diff options
Diffstat (limited to 'malloc')
-rw-r--r-- | malloc/tst-malloc-backtrace.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/malloc/tst-malloc-backtrace.c b/malloc/tst-malloc-backtrace.c index 2e24157907..7b317bbdb2 100644 --- a/malloc/tst-malloc-backtrace.c +++ b/malloc/tst-malloc-backtrace.c @@ -30,12 +30,22 @@ call_free (void *ptr) *(size_t *)(ptr - sizeof (size_t)) = 1; } +int do_test (void); + +#define TEST_FUNCTION do_test () +#define EXPECTED_SIGNAL SIGABRT + +#include "../test-skeleton.c" + int do_test (void) { void *ptr1 = malloc (SIZE); void *ptr2 = malloc (SIZE); + /* Avoid unwanted output to TTY after an expected memory corruption. */ + ignore_stderr(); + call_free (ptr1); ptr1 = malloc (SIZE); @@ -43,8 +53,3 @@ do_test (void) doesn't optimize out that malloc call. */ return (ptr1 == ptr2); } - -#define TEST_FUNCTION do_test () -#define EXPECTED_SIGNAL SIGABRT - -#include "../test-skeleton.c" |