From d38ad7827e0a20310292e40242006b90ddd8703a Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Mon, 23 Feb 2009 10:54:15 +0000 Subject: - remove dependency on GNU error functionality --- test/malloc/tst-calloc.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'test') diff --git a/test/malloc/tst-calloc.c b/test/malloc/tst-calloc.c index b3594c937..eb0059f68 100644 --- a/test/malloc/tst-calloc.c +++ b/test/malloc/tst-calloc.c @@ -18,12 +18,12 @@ 02111-1307 USA. */ #include -#include #include #include #include #include +static int errors = 0; /* Number of samples per size. */ #define N 50000 @@ -46,10 +46,11 @@ fixed_test (int size) for (j = 0; j < size; ++j) { - if (ptrs[i][j] != '\0') - error (EXIT_FAILURE, 0, - "byte not cleared (size %d, element %d, byte %d)", + if (ptrs[i][j] != '\0') { + ++errors; + printf("byte not cleared (size %d, element %d, byte %d)", size, i, j); + } ptrs[i][j] = '\xff'; } } @@ -79,10 +80,11 @@ random_test (void) for (j = 0; j < size; ++j) { - if (ptrs[i][j] != '\0') - error (EXIT_FAILURE, 0, - "byte not cleared (size %d, element %d, byte %d)", + if (ptrs[i][j] != '\0') { + ++errors; + printf("byte not cleared (size %d, element %d, byte %d)", size, i, j); + } ptrs[i][j] = '\xff'; } } @@ -122,5 +124,5 @@ main (void) null_test (); - return 0; + return errors != 0; } -- cgit v1.2.3