svn commit: trunk/uClibc/test/malloc

aldot at uclibc.org aldot at uclibc.org
Mon Feb 23 10:54:15 UTC 2009


Author: aldot
Date: 2009-02-23 10:54:15 +0000 (Mon, 23 Feb 2009)
New Revision: 25424

Log:
- remove dependency on GNU error functionality


Modified:
   trunk/uClibc/test/malloc/tst-calloc.c


Changeset:
Modified: trunk/uClibc/test/malloc/tst-calloc.c
===================================================================
--- trunk/uClibc/test/malloc/tst-calloc.c	2009-02-23 10:51:00 UTC (rev 25423)
+++ trunk/uClibc/test/malloc/tst-calloc.c	2009-02-23 10:54:15 UTC (rev 25424)
@@ -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 @@
 
       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 @@
 
       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 @@
 
   null_test ();
 
-  return 0;
+  return errors != 0;
 }



More information about the uClibc-cvs mailing list