svn commit: branches/uClibc_0_9_30/test/misc

aldot at uclibc.org aldot at uclibc.org
Tue Feb 24 14:30:22 UTC 2009


Author: aldot
Date: 2009-02-24 14:30:21 +0000 (Tue, 24 Feb 2009)
New Revision: 25444

Log:
- remove dependency on GNU error()


Modified:
   branches/uClibc_0_9_30/test/misc/Makefile
   branches/uClibc_0_9_30/test/misc/tst-utmp.c


Changeset:
Modified: branches/uClibc_0_9_30/test/misc/Makefile
===================================================================
--- branches/uClibc_0_9_30/test/misc/Makefile	2009-02-24 13:30:03 UTC (rev 25443)
+++ branches/uClibc_0_9_30/test/misc/Makefile	2009-02-24 14:30:21 UTC (rev 25444)
@@ -2,7 +2,10 @@
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
 TESTS_DISABLED := outb tst-fnmatch bug-glob1 tst-gnuglob
-
+include ../../.config
+ifeq ($(UCLIBC_HAS_GLOB),)
+TESTS_DISABLED += bug-glob2
+endif
 include ../Test.mak
 
 CFLAGS_dirent64 := -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64

Modified: branches/uClibc_0_9_30/test/misc/tst-utmp.c
===================================================================
--- branches/uClibc_0_9_30/test/misc/tst-utmp.c	2009-02-24 13:30:03 UTC (rev 25443)
+++ branches/uClibc_0_9_30/test/misc/tst-utmp.c	2009-02-24 14:30:21 UTC (rev 25444)
@@ -19,7 +19,6 @@
    02111-1307 USA.  */
 
 #include <errno.h>
-#include <error.h>
 #include <stdlib.h>
 #include <string.h>
 #include <sys/types.h>
@@ -56,6 +55,7 @@
 /* These are for the temporary file we generate.  */
 char *name;
 int fd;
+static unsigned errors = 0;
 
 static void
 do_prepare (int argc, char *argv[])
@@ -70,8 +70,10 @@
 
   /* Open our test file.  */
   fd = mkstemp (name);
-  if (fd == -1)
-    error (EXIT_FAILURE, errno, "cannot open test file `%s'", name);
+  if (fd == -1) {
+    printf ("cannot open test file `%s' (%d)", name, errno);
+    ++errors;
+  }
 }
 
 struct utmp entry[] =
@@ -111,7 +113,8 @@
     {
       if (pututline (&entry[n]) == NULL)
 	{
-	  error (0, errno, "cannot write UTMP entry");
+	  perror ("cannot write UTMP entry");
+	  ++errors;
 	  return 1;
 	}
     }
@@ -136,7 +139,8 @@
       if (n < num_entries &&
 	  memcmp (ut, &entry[n], sizeof (struct utmp)))
 	{
-	  error (0, 0, "UTMP entry does not match");
+	  printf ("UTMP entry does not match");
+	  ++errors;
 	  return 1;
 	}
 
@@ -145,7 +149,8 @@
 
   if (n != num_entries)
     {
-      error (0, 0, "number of UTMP entries is incorrect");
+      printf ("number of UTMP entries is incorrect");
+      ++errors;
       return 1;
     }
 
@@ -177,7 +182,8 @@
 
 	  if (pututline (&entry[n]) == NULL)
 	    {
-	      error (0, errno, "cannot write UTMP entry");
+	      perror("cannot write UTMP entry");
+	      ++errors;
 	      return 1;
 	    }
 
@@ -187,7 +193,8 @@
 	}
     }
 
-  error (0, 0, "no entries available");
+  printf ("no entries available");
+  ++errors;
   return 1;
 }
 
@@ -211,7 +218,8 @@
 
 	  if (pututline (&entry[n]) == NULL)
 	    {
-	      error (0, errno, "cannot write UTMP entry");
+	      perror("cannot write UTMP entry");
+	      ++errors;
 	      return 1;
 	    }
 
@@ -221,7 +229,8 @@
 	}
     }
 
-  error (0, 0, "no entry found for `%s'", line);
+  printf ("no entry found for `%s'", line);
+  ++errors;
   return 1;
 }
 
@@ -238,7 +247,8 @@
   up = getutline (&ut);
   if (up == NULL)
     {
-      error (0, errno, "cannot get entry for line `%s'", line);
+      printf("cannot get entry for line `%s' (%d)", line, errno);
+      ++errors;
       return 1;
     }
 
@@ -250,7 +260,8 @@
 	{
 	  if (memcmp (up, &entry[n], sizeof (struct utmp)))
 	    {
-	      error (0, 0, "UTMP entry does not match");
+	      printf ("UTMP entry does not match");
+	      ++errors;
 	      return 1;
 	    }
 
@@ -258,7 +269,8 @@
 	}
     }
 
-  error (0, 0, "bogus entry for line `%s'", line);
+  printf ("bogus entry for line `%s'", line);
+  ++errors;
   return 1;
 }
 
@@ -272,7 +284,8 @@
   strcpy (ut.ut_line, line);
   if (getutline (&ut) != NULL)
     {
-      error (0, 0, "bogus login entry for `%s'", line);
+      printf ("bogus login entry for `%s'", line);
+      ++errors;
       return 1;
     }
 
@@ -295,7 +308,8 @@
   up = getutid (&ut);
   if (up == NULL)
     {
-      error (0, errno, "cannot get entry for ID `%s'", id);
+      printf ("cannot get entry for ID `%s' (%d)", id, errno);
+      ++errors;
       return 1;
     }
 
@@ -307,7 +321,8 @@
 	{
 	  if (memcmp (up, &entry[n], sizeof (struct utmp)))
 	    {
-	      error (0, 0, "UTMP entry does not match");
+	      printf ("UTMP entry does not match");
+	      ++errors;
 	      return 1;
 	    }
 
@@ -315,7 +330,8 @@
 	}
     }
 
-  error (0, 0, "bogus entry for ID `%s'", id);
+  printf ("bogus entry for ID `%s'", id);
+  ++errors;
   return 1;
 }
 
@@ -332,7 +348,8 @@
   up = getutid (&ut);
   if (up == NULL)
     {
-      error (0, errno, "cannot get entry for type `%d'", type);
+      printf ("cannot get entry for type `%d' (%d)", type, errno);
+      ++errors;
       return 1;
     }
 
@@ -344,7 +361,8 @@
 	{
 	  if (memcmp (up, &entry[n], sizeof (struct utmp)))
 	    {
-	      error (0, 0, "UTMP entry does not match");
+	      printf ("UTMP entry does not match");
+	      ++errors;
 	      return 1;
 	    }
 
@@ -352,7 +370,8 @@
 	}
     }
 
-  error (0, 0, "bogus entry for type `%d'", type);
+  printf ("bogus entry for type `%d'", type);
+  ++errors;
   return 1;
 }
 



More information about the uClibc-cvs mailing list