diff options
author | "Steven J. Hill" <sjhill@realitydiluted.com> | 2006-03-17 03:00:05 +0000 |
---|---|---|
committer | "Steven J. Hill" <sjhill@realitydiluted.com> | 2006-03-17 03:00:05 +0000 |
commit | fc6389aa6a03de5c88ea89a75f0992e65f7c4dc8 (patch) | |
tree | 9c9f29c56d961284d621ea9756425a5e73e74c56 /test | |
parent | 18811a88f74a8a0d2d54e275cd632b47817458a1 (diff) |
Fix 'realloc' and revert previous changes to tests. malloc tests all pass regardless of the setting of MALLOC_GLIBC_COMPAT.
Diffstat (limited to 'test')
-rw-r--r-- | test/malloc/malloc.c | 4 | ||||
-rw-r--r-- | test/malloc/tst-malloc.c | 15 | ||||
-rw-r--r-- | test/malloc/tst-mcheck.c | 8 |
3 files changed, 0 insertions, 27 deletions
diff --git a/test/malloc/malloc.c b/test/malloc/malloc.c index b35e329c0..d63856845 100644 --- a/test/malloc/malloc.c +++ b/test/malloc/malloc.c @@ -70,11 +70,7 @@ int test2(void) ptr = malloc(100); ptr = realloc(ptr, 0); -#ifdef __MALLOC_GLIBC_COMPAT__ - if (!ptr) { -#else if (ptr) { -#endif printf("realloc(,0) failed\n"); ++ret; free(ptr); diff --git a/test/malloc/tst-malloc.c b/test/malloc/tst-malloc.c index 95d8a6c50..468e1d4ba 100644 --- a/test/malloc/tst-malloc.c +++ b/test/malloc/tst-malloc.c @@ -54,16 +54,9 @@ 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) @@ -73,16 +66,8 @@ 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; } diff --git a/test/malloc/tst-mcheck.c b/test/malloc/tst-mcheck.c index 7476538d8..af72c042b 100644 --- a/test/malloc/tst-mcheck.c +++ b/test/malloc/tst-mcheck.c @@ -50,11 +50,7 @@ main (void) merror ("malloc (10) failed."); p = realloc (p, 0); -#ifdef __MALLOC_GLIBC_COMPAT__ - if (!p) -#else if (p != NULL) -#endif merror ("realloc (p, 0) failed."); p = malloc (0); @@ -66,11 +62,7 @@ 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."); q = malloc (256); |