From c1f4108352e446285e99f046e3929ed13d5e9851 Mon Sep 17 00:00:00 2001 From: Arjun Shankar Date: Mon, 3 Aug 2015 16:14:21 +0000 Subject: Modify several tests to use test-skeleton.c 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. --- stdio-common/test-fwrite.c | 7 +++++-- stdio-common/tst-ferror.c | 7 +++++-- stdio-common/tst-printf.c | 7 +++++-- stdio-common/tst-printfsz.c | 7 +++++-- 4 files changed, 20 insertions(+), 8 deletions(-) (limited to 'stdio-common') diff --git a/stdio-common/test-fwrite.c b/stdio-common/test-fwrite.c index ce54169931..5677c6da80 100644 --- a/stdio-common/test-fwrite.c +++ b/stdio-common/test-fwrite.c @@ -1,8 +1,8 @@ #include #include -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 5f23002c7a..69592df048 100644 --- a/stdio-common/tst-ferror.c +++ b/stdio-common/tst-ferror.c @@ -1,7 +1,7 @@ #include -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 8011033d73..88525084e8 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 902b2ac27b..8a3385f94d 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" -- cgit 1.4.1