summaryrefslogtreecommitdiff
path: root/test/malloc/tst-calloc.c
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2009-02-23 10:54:15 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2009-02-23 10:54:15 +0000
commitd38ad7827e0a20310292e40242006b90ddd8703a (patch)
treeee2cbfa5fa33454a5acb4400d4d13e57debbe364 /test/malloc/tst-calloc.c
parent3ec57a9f7e1bb776de6e2fc9f95589ac9fd9dc57 (diff)
- remove dependency on GNU error functionality
Diffstat (limited to 'test/malloc/tst-calloc.c')
-rw-r--r--test/malloc/tst-calloc.c18
1 files changed, 10 insertions, 8 deletions
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 <errno.h>
-#include <error.h>
#include <limits.h>
#include <malloc.h>
#include <stdlib.h>
#include <stdio.h>
+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;
}