From 18811a88f74a8a0d2d54e275cd632b47817458a1 Mon Sep 17 00:00:00 2001 From: "\"Steven J. Hill\"" Date: Fri, 17 Mar 2006 02:43:51 +0000 Subject: Fix tests to work if MALLOC_GLIBC_COMPAT is enabled. --- test/malloc/tst-malloc.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test/malloc/tst-malloc.c') diff --git a/test/malloc/tst-malloc.c b/test/malloc/tst-malloc.c index 468e1d4ba..95d8a6c50 100644 --- a/test/malloc/tst-malloc.c +++ b/test/malloc/tst-malloc.c @@ -54,9 +54,16 @@ main (void) /* realloc (p, 0) == free (p). */ p = realloc (p, 0); +#ifdef __MALLOC_GLIBC_COMPAT__ + if (!p) +#else if (p != NULL) +#endif merror ("realloc (p, 0) failed."); +#ifdef __MALLOC_GLIBC_COMPAT__ + free (p); +#endif p = malloc (0); #if !defined(__UCLIBC__) || defined(__MALLOC_GLIBC_COMPAT__) if (p == NULL) @@ -66,8 +73,16 @@ main (void) merror ("malloc (0) failed."); p = realloc (p, 0); +#ifdef __MALLOC_GLIBC_COMPAT__ + if (!p) +#else if (p != NULL) +#endif merror ("realloc (p, 0) failed."); +#ifdef __MALLOC_GLIBC_COMPAT__ + free (p); +#endif + return errors != 0; } -- cgit v1.2.3