Modify several tests to use test-skeleton.c
diff mbox

Message ID 20150803161421.GA28622@aloka.lostca.se
State New
Headers show

Commit Message

Arjun Shankar Aug. 3, 2015, 4:14 p.m. UTC
These tests were skipped by the use-test-skeleton conversion done in
commit 29955b5d because they did not have an `int main (void)'
declaration. Instead their `main' functions were declared with arguments
(i.e. argc, argv) even though they didn't use them.

Remove these arguments and include the test skeleton in these tests.

ChangeLog:

2015-08-03  Arjun Shankar  <arjun.is@lostca.se>

	* dirent/tst-seekdir.c (main): Converted to ...
	(do_test): ... this.
	(TEST_FUNCTION): New macro.
	Include test-skeleton.c.
	* elf/tst-dlmodcount.c (main): Converted to ...
	(do_test): ... this.
	(TEST_FUNCTION): New macro.
	Include test-skeleton.c.
	* elf/tst-order-main.c (main): Converted to ...
	(do_test): ... this.
	(TEST_FUNCTION): New macro.
	Include test-skeleton.c.
	* elf/tst-pie2.c (main): Converted to ...
	(do_test): ... this.
	(TEST_FUNCTION): New macro.
	Include test-skeleton.c.
	* inet/tst-ether_aton.c (main): Converted to ...
	(do_test): ... this.
	(TEST_FUNCTION): New macro.
	Include test-skeleton.c.
	* misc/tst-mntent.c (main): Converted to ...
	(do_test): ... this.
	(TEST_FUNCTION): New macro.
	Include test-skeleton.c.
	* misc/tst-tsearch.c (main): Converted to ...
	(do_test): ... this.
	(TEST_FUNCTION): New macro.
	Include test-skeleton.c.
	* posix/tst-regexloc.c (main): Converted to ...
	(do_test): ... this.
	(TEST_FUNCTION): New macro.
	Include test-skeleton.c.
	* resolv/tst-aton.c (main): Converted to ...
	(do_test): ... this.
	(TEST_FUNCTION): New macro.
	Include test-skeleton.c.
	* stdio-common/test-fwrite.c (main): Converted to ...
	(do_test): ... this.
	(TEST_FUNCTION): New macro.
	Include test-skeleton.c.
	* stdio-common/tst-ferror.c (main): Converted to ...
	(do_test): ... this.
	(TEST_FUNCTION): New macro.
	Include test-skeleton.c.
	* stdio-common/tst-printf.c (main): Converted to ...
	(do_test): ... this.
	(TEST_FUNCTION): New macro.
	Include test-skeleton.c.
	* stdio-common/tst-printfsz.c (main): Converted to ...
	(do_test): ... this.
	(TEST_FUNCTION): New macro.
	Include test-skeleton.c.
	* stdlib/tst-strtod.c (main): Converted to ...
	(do_test): ... this.
	(TEST_FUNCTION): New macro.
	Include test-skeleton.c.
	* string/tst-strlen.c (main): Converted to ...
	(do_test): ... this.
	(TEST_FUNCTION): New macro.
	Include test-skeleton.c.
	* string/tst-svc.c (main): Converted to ...
	(do_test): ... this.
	(TEST_FUNCTION): New macro.
	Include test-skeleton.c.
	* time/tst-strptime.c (main): Converted to ...
	(do_test): ... this.
	(TEST_FUNCTION): New macro.
	Include test-skeleton.c.
	* timezone/tst-timezone.c (main): Converted to ...
	(do_test): ... this.
	(TEST_FUNCTION): New macro.
	Include test-skeleton.c.
---
 dirent/tst-seekdir.c        | 7 +++++--
 elf/tst-dlmodcount.c        | 7 +++++--
 elf/tst-order-main.c        | 7 +++++--
 elf/tst-pie2.c              | 7 +++++--
 inet/tst-ether_aton.c       | 7 +++++--
 misc/tst-mntent.c           | 7 +++++--
 misc/tst-tsearch.c          | 7 +++++--
 posix/tst-regexloc.c        | 7 +++++--
 resolv/tst-aton.c           | 7 +++++--
 stdio-common/test-fwrite.c  | 7 +++++--
 stdio-common/tst-ferror.c   | 7 +++++--
 stdio-common/tst-printf.c   | 7 +++++--
 stdio-common/tst-printfsz.c | 7 +++++--
 stdlib/tst-strtod.c         | 7 +++++--
 string/tst-strlen.c         | 7 +++++--
 string/tst-svc.c            | 7 +++++--
 time/tst-strptime.c         | 7 +++++--
 timezone/tst-timezone.c     | 7 +++++--
 18 files changed, 90 insertions(+), 36 deletions(-)

Tested on x86_64 with no regressions.

Comments

Mike Frysinger Aug. 6, 2015, 7:01 a.m. UTC | #1
On 03 Aug 2015 16:14, Arjun Shankar wrote:
> These tests were skipped by the use-test-skeleton conversion done in
> commit 29955b5d because they did not have an `int main (void)'
> declaration. Instead their `main' functions were declared with arguments
> (i.e. argc, argv) even though they didn't use them.
> 
> Remove these arguments and include the test skeleton in these tests.

thanks, pushed now
-mike

Patch
diff mbox

diff --git a/dirent/tst-seekdir.c b/dirent/tst-seekdir.c
index 43808fe..dcdd699 100644
--- a/dirent/tst-seekdir.c
+++ b/dirent/tst-seekdir.c
@@ -2,8 +2,8 @@ 
 #include <dirent.h>
 #include <stdlib.h>
 
-int
-main (int argc, char *argv[])
+static int
+do_test (void)
 {
   DIR * dirp;
   long int save3 = 0;
@@ -76,3 +76,6 @@  main (int argc, char *argv[])
   closedir (dirp);
   return result;
 }
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/elf/tst-dlmodcount.c b/elf/tst-dlmodcount.c
index 64df2fa..6cfa366 100644
--- a/elf/tst-dlmodcount.c
+++ b/elf/tst-dlmodcount.c
@@ -92,8 +92,8 @@  unload (const char *path, void *handle)
   dl_iterate_phdr (callback, (void *)(intptr_t) REMOVE);
 }
 
-int
-main (int argc, char **argv)
+static int
+do_test (void)
 {
   void *handle1, *handle2;
 
@@ -104,3 +104,6 @@  main (int argc, char **argv)
   unload ("globalmod1.so", handle2);
   return 0;
 }
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/elf/tst-order-main.c b/elf/tst-order-main.c
index 80f4f6b..339778a 100644
--- a/elf/tst-order-main.c
+++ b/elf/tst-order-main.c
@@ -2,9 +2,12 @@ 
 #include <unistd.h>
 #include <stdlib.h>
 
-int
-main( int argc, char *argv[] )
+static int
+do_test (void)
 {
   printf( "main\n" );
   exit(EXIT_SUCCESS);
 }
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/elf/tst-pie2.c b/elf/tst-pie2.c
index b76b323..a22fc52 100644
--- a/elf/tst-pie2.c
+++ b/elf/tst-pie2.c
@@ -31,8 +31,11 @@  init_g (void)
   g += 1;
 }
 
-int
-main (int argc, char *argv[])
+static int
+do_test (void)
 {
   return 0;
 }
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/inet/tst-ether_aton.c b/inet/tst-ether_aton.c
index 94ceec8..eba350e 100644
--- a/inet/tst-ether_aton.c
+++ b/inet/tst-ether_aton.c
@@ -2,8 +2,8 @@ 
 #include <string.h>
 #include <netinet/ether.h>
 
-int
-main (int argc, char *argv[])
+static int
+do_test (void)
 {
   struct ether_addr *valp, val;
   int result, r;
@@ -55,3 +55,6 @@  main (int argc, char *argv[])
 
   return result;
 }
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/misc/tst-mntent.c b/misc/tst-mntent.c
index 876c89f..932fd3f 100644
--- a/misc/tst-mntent.c
+++ b/misc/tst-mntent.c
@@ -5,8 +5,8 @@ 
 #include <string.h>
 
 
-int
-main (int argc, char *argv[])
+static int
+do_test (void)
 {
   int result = 0;
   struct mntent mef;
@@ -97,3 +97,6 @@  main (int argc, char *argv[])
 
   return result;
 }
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/misc/tst-tsearch.c b/misc/tst-tsearch.c
index 70b6c33..dca2282 100644
--- a/misc/tst-tsearch.c
+++ b/misc/tst-tsearch.c
@@ -248,8 +248,8 @@  mangle_tree (enum order how, enum action what, void **root, int lag)
 }
 
 
-int
-main (int argc, char **argv)
+static int
+do_test (void)
 {
   int total_error = 0;
   static char state[8] = { 1, 2, 3, 4, 5, 6, 7, 8 };
@@ -350,3 +350,6 @@  main (int argc, char **argv)
 
   return total_error;
 }
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/posix/tst-regexloc.c b/posix/tst-regexloc.c
index 38bf87a..62b739e 100644
--- a/posix/tst-regexloc.c
+++ b/posix/tst-regexloc.c
@@ -23,8 +23,8 @@ 
 #include <locale.h>
 #include <stdio.h>
 
-int
-main (int argc, char *argv[])
+static int
+do_test (void)
 {
   regex_t re;
   regmatch_t mat[1];
@@ -44,3 +44,6 @@  main (int argc, char *argv[])
 
   return res;
 }
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/resolv/tst-aton.c b/resolv/tst-aton.c
index 4e9caf9..08110a0 100644
--- a/resolv/tst-aton.c
+++ b/resolv/tst-aton.c
@@ -44,8 +44,8 @@  static struct tests
 };
 
 
-int
-main (int argc, char *argv[])
+static int
+do_test (void)
 {
   int result = 0;
   size_t cnt;
@@ -72,3 +72,6 @@  main (int argc, char *argv[])
 
   return result;
 }
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/stdio-common/test-fwrite.c b/stdio-common/test-fwrite.c
index ce54169..5677c6d 100644
--- a/stdio-common/test-fwrite.c
+++ b/stdio-common/test-fwrite.c
@@ -1,8 +1,8 @@ 
 #include <stdio.h>
 #include <string.h>
 
-int
-main (int argc, char *argv[])
+static int
+do_test (void)
 {
   FILE *f = tmpfile ();
   char obuf[99999], ibuf[sizeof obuf];
@@ -66,3 +66,6 @@  There is absolutely no warranty for GDB; type \"show warranty\" for details.\n\
   puts ("Test succeeded.");
   return 0;
 }
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/stdio-common/tst-ferror.c b/stdio-common/tst-ferror.c
index 5f23002..69592df 100644
--- a/stdio-common/tst-ferror.c
+++ b/stdio-common/tst-ferror.c
@@ -1,7 +1,7 @@ 
 #include <stdio.h>
 
-int
-main (int argc, char *argv[])
+static int
+do_test (void)
 {
   char buf[100];
   int result = 0;
@@ -39,3 +39,6 @@  main (int argc, char *argv[])
     }
   return result;
 }
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/stdio-common/tst-printf.c b/stdio-common/tst-printf.c
index 8011033..8852508 100644
--- a/stdio-common/tst-printf.c
+++ b/stdio-common/tst-printf.c
@@ -132,8 +132,8 @@  fp_test (void)
   printf("%-10s\n", (char *) NULL);
 }
 
-int
-main (int argc, char *argv[])
+static int
+do_test (void)
 {
   static char shortstr[] = "Hi, Z.";
   static char longstr[] = "Good morning, Doctor Chandra.  This is Hal.  \
@@ -393,3 +393,6 @@  rfg3 (void)
     printf ("got: '%s', expected: '%s'\n", buf,
 	    "   12345  1234    11145401322     321.765432   3.217654e+02   5    test-string");
 }
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/stdio-common/tst-printfsz.c b/stdio-common/tst-printfsz.c
index 902b2ac..8a3385f 100644
--- a/stdio-common/tst-printfsz.c
+++ b/stdio-common/tst-printfsz.c
@@ -7,8 +7,8 @@ 
 #define V       12345678.12345678
 
 
-int
-main (int argc, char *argv[])
+static int
+do_test (void)
 {
   char buf[1024];
   int result = 0;
@@ -76,3 +76,6 @@  main (int argc, char *argv[])
 
   return result;
 }
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/stdlib/tst-strtod.c b/stdlib/tst-strtod.c
index a469208..b985990 100644
--- a/stdlib/tst-strtod.c
+++ b/stdlib/tst-strtod.c
@@ -81,8 +81,8 @@  static void expand (char *dst, int c);
 static int long_dbl (void);
 static int locale_test (void);
 
-int
-main (int argc, char ** argv)
+static int
+do_test (void)
 {
   char buf[100];
   const struct ltest *lt;
@@ -276,3 +276,6 @@  locale_test (void)
 
   return result;
 }
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/string/tst-strlen.c b/string/tst-strlen.c
index 8cbe441..8376831 100644
--- a/string/tst-strlen.c
+++ b/string/tst-strlen.c
@@ -5,8 +5,8 @@ 
 #include <stdio.h>
 #include <string.h>
 
-int
-main(int argc, char *argv[])
+static int
+do_test (void)
 {
   static const size_t lens[] = { 0, 1, 0, 2, 0, 1, 0, 3,
 				 0, 1, 0, 2, 0, 1, 0, 4 };
@@ -53,3 +53,6 @@  strnlen failed for base=%Zu, words=%Zu, and last=%Zu (is %zd, expected %zd)\n",
     }
   return 0;
 }
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/string/tst-svc.c b/string/tst-svc.c
index 1ee5342..1b0da3e 100644
--- a/string/tst-svc.c
+++ b/string/tst-svc.c
@@ -13,8 +13,8 @@  compare (const void *p1, const void *p2)
   return strverscmp (*((char **) p1), *((char **) p2));
 }
 
-int
-main (int argc, char *argv[])
+static int
+do_test (void)
 {
   char line[MAX_LINE_SIZE + 1];
   char *str[MAX_STRINGS];
@@ -43,3 +43,6 @@  main (int argc, char *argv[])
 
   return EXIT_SUCCESS;
 }
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/time/tst-strptime.c b/time/tst-strptime.c
index 8c0a947..9a2199f 100644
--- a/time/tst-strptime.c
+++ b/time/tst-strptime.c
@@ -124,8 +124,8 @@  test_tm (void)
 }
 
 
-int
-main (int argc, char *argv[])
+static int
+do_test (void)
 {
   struct tm tm;
   size_t i;
@@ -194,3 +194,6 @@  main (int argc, char *argv[])
 
   return result;
 }
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/timezone/tst-timezone.c b/timezone/tst-timezone.c
index 7152809..0223a80 100644
--- a/timezone/tst-timezone.c
+++ b/timezone/tst-timezone.c
@@ -87,8 +87,8 @@  check_tzvars (const char *name, int dayl, int timez, const char *const tznam[])
 }
 
 
-int
-main (int argc, char ** argv)
+static int
+do_test (void)
 {
   time_t t;
   const struct test_times *pt;
@@ -166,3 +166,6 @@  main (int argc, char ** argv)
 
   return failed ? EXIT_FAILURE : EXIT_SUCCESS;
 }
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"