Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Modify several tests to use test-skeleton.c
These tests were skipped by the use-test-skeleton conversion done in
commit 29955b5 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.
  • Loading branch information
Arjun Shankar authored and Mike Frysinger committed Aug 6, 2015
1 parent a03ba36 commit c1f4108
Show file tree
Hide file tree
Showing 19 changed files with 165 additions and 36 deletions.
75 changes: 75 additions & 0 deletions ChangeLog
@@ -1,3 +1,78 @@
2015-08-06 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.

2015-08-05 Zack Weinberg <zackw@panix.com>

* misc/regexp.h: Update comments.
Expand Down
7 changes: 5 additions & 2 deletions dirent/tst-seekdir.c
Expand Up @@ -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;
Expand Down Expand Up @@ -76,3 +76,6 @@ main (int argc, char *argv[])
closedir (dirp);
return result;
}

#define TEST_FUNCTION do_test ()
#include "../test-skeleton.c"
7 changes: 5 additions & 2 deletions elf/tst-dlmodcount.c
Expand Up @@ -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;

Expand All @@ -104,3 +104,6 @@ main (int argc, char **argv)
unload ("globalmod1.so", handle2);
return 0;
}

#define TEST_FUNCTION do_test ()
#include "../test-skeleton.c"
7 changes: 5 additions & 2 deletions elf/tst-order-main.c
Expand Up @@ -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"
7 changes: 5 additions & 2 deletions elf/tst-pie2.c
Expand Up @@ -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"
7 changes: 5 additions & 2 deletions inet/tst-ether_aton.c
Expand Up @@ -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;
Expand Down Expand Up @@ -55,3 +55,6 @@ main (int argc, char *argv[])

return result;
}

#define TEST_FUNCTION do_test ()
#include "../test-skeleton.c"
7 changes: 5 additions & 2 deletions misc/tst-mntent.c
Expand Up @@ -5,8 +5,8 @@
#include <string.h>


int
main (int argc, char *argv[])
static int
do_test (void)
{
int result = 0;
struct mntent mef;
Expand Down Expand Up @@ -97,3 +97,6 @@ main (int argc, char *argv[])

return result;
}

#define TEST_FUNCTION do_test ()
#include "../test-skeleton.c"
7 changes: 5 additions & 2 deletions misc/tst-tsearch.c
Expand Up @@ -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 };
Expand Down Expand Up @@ -350,3 +350,6 @@ main (int argc, char **argv)

return total_error;
}

#define TEST_FUNCTION do_test ()
#include "../test-skeleton.c"
7 changes: 5 additions & 2 deletions posix/tst-regexloc.c
Expand Up @@ -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];
Expand All @@ -44,3 +44,6 @@ main (int argc, char *argv[])

return res;
}

#define TEST_FUNCTION do_test ()
#include "../test-skeleton.c"
7 changes: 5 additions & 2 deletions resolv/tst-aton.c
Expand Up @@ -44,8 +44,8 @@ static struct tests
};


int
main (int argc, char *argv[])
static int
do_test (void)
{
int result = 0;
size_t cnt;
Expand All @@ -72,3 +72,6 @@ main (int argc, char *argv[])

return result;
}

#define TEST_FUNCTION do_test ()
#include "../test-skeleton.c"
7 changes: 5 additions & 2 deletions 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];
Expand Down Expand Up @@ -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"
7 changes: 5 additions & 2 deletions 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;
Expand Down Expand Up @@ -39,3 +39,6 @@ main (int argc, char *argv[])
}
return result;
}

#define TEST_FUNCTION do_test ()
#include "../test-skeleton.c"
7 changes: 5 additions & 2 deletions stdio-common/tst-printf.c
Expand Up @@ -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. \
Expand Down Expand Up @@ -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"
7 changes: 5 additions & 2 deletions stdio-common/tst-printfsz.c
Expand Up @@ -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;
Expand Down Expand Up @@ -76,3 +76,6 @@ main (int argc, char *argv[])

return result;
}

#define TEST_FUNCTION do_test ()
#include "../test-skeleton.c"
7 changes: 5 additions & 2 deletions stdlib/tst-strtod.c
Expand Up @@ -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;
Expand Down Expand Up @@ -276,3 +276,6 @@ locale_test (void)

return result;
}

#define TEST_FUNCTION do_test ()
#include "../test-skeleton.c"
7 changes: 5 additions & 2 deletions string/tst-strlen.c
Expand Up @@ -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 };
Expand Down Expand Up @@ -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"
7 changes: 5 additions & 2 deletions string/tst-svc.c
Expand Up @@ -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];
Expand Down Expand Up @@ -43,3 +43,6 @@ main (int argc, char *argv[])

return EXIT_SUCCESS;
}

#define TEST_FUNCTION do_test ()
#include "../test-skeleton.c"
7 changes: 5 additions & 2 deletions time/tst-strptime.c
Expand Up @@ -124,8 +124,8 @@ test_tm (void)
}


int
main (int argc, char *argv[])
static int
do_test (void)
{
struct tm tm;
size_t i;
Expand Down Expand Up @@ -194,3 +194,6 @@ main (int argc, char *argv[])

return result;
}

#define TEST_FUNCTION do_test ()
#include "../test-skeleton.c"
7 changes: 5 additions & 2 deletions timezone/tst-timezone.c
Expand Up @@ -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;
Expand Down Expand Up @@ -166,3 +166,6 @@ main (int argc, char ** argv)

return failed ? EXIT_FAILURE : EXIT_SUCCESS;
}

#define TEST_FUNCTION do_test ()
#include "../test-skeleton.c"

0 comments on commit c1f4108

Please sign in to comment.