Skip to content
This repository was archived by the owner on Feb 5, 2022. It is now read-only.

Commit c1f4108

Browse files
submachinevapier
authored andcommitted
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.
1 parent a03ba36 commit c1f4108

19 files changed

+165
-36
lines changed

ChangeLog

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,78 @@
1+
2015-08-06 Arjun Shankar <[email protected]>
2+
3+
* dirent/tst-seekdir.c (main): Converted to ...
4+
(do_test): ... this.
5+
(TEST_FUNCTION): New macro.
6+
Include test-skeleton.c.
7+
* elf/tst-dlmodcount.c (main): Converted to ...
8+
(do_test): ... this.
9+
(TEST_FUNCTION): New macro.
10+
Include test-skeleton.c.
11+
* elf/tst-order-main.c (main): Converted to ...
12+
(do_test): ... this.
13+
(TEST_FUNCTION): New macro.
14+
Include test-skeleton.c.
15+
* elf/tst-pie2.c (main): Converted to ...
16+
(do_test): ... this.
17+
(TEST_FUNCTION): New macro.
18+
Include test-skeleton.c.
19+
* inet/tst-ether_aton.c (main): Converted to ...
20+
(do_test): ... this.
21+
(TEST_FUNCTION): New macro.
22+
Include test-skeleton.c.
23+
* misc/tst-mntent.c (main): Converted to ...
24+
(do_test): ... this.
25+
(TEST_FUNCTION): New macro.
26+
Include test-skeleton.c.
27+
* misc/tst-tsearch.c (main): Converted to ...
28+
(do_test): ... this.
29+
(TEST_FUNCTION): New macro.
30+
Include test-skeleton.c.
31+
* posix/tst-regexloc.c (main): Converted to ...
32+
(do_test): ... this.
33+
(TEST_FUNCTION): New macro.
34+
Include test-skeleton.c.
35+
* resolv/tst-aton.c (main): Converted to ...
36+
(do_test): ... this.
37+
(TEST_FUNCTION): New macro.
38+
Include test-skeleton.c.
39+
* stdio-common/test-fwrite.c (main): Converted to ...
40+
(do_test): ... this.
41+
(TEST_FUNCTION): New macro.
42+
Include test-skeleton.c.
43+
* stdio-common/tst-ferror.c (main): Converted to ...
44+
(do_test): ... this.
45+
(TEST_FUNCTION): New macro.
46+
Include test-skeleton.c.
47+
* stdio-common/tst-printf.c (main): Converted to ...
48+
(do_test): ... this.
49+
(TEST_FUNCTION): New macro.
50+
Include test-skeleton.c.
51+
* stdio-common/tst-printfsz.c (main): Converted to ...
52+
(do_test): ... this.
53+
(TEST_FUNCTION): New macro.
54+
Include test-skeleton.c.
55+
* stdlib/tst-strtod.c (main): Converted to ...
56+
(do_test): ... this.
57+
(TEST_FUNCTION): New macro.
58+
Include test-skeleton.c.
59+
* string/tst-strlen.c (main): Converted to ...
60+
(do_test): ... this.
61+
(TEST_FUNCTION): New macro.
62+
Include test-skeleton.c.
63+
* string/tst-svc.c (main): Converted to ...
64+
(do_test): ... this.
65+
(TEST_FUNCTION): New macro.
66+
Include test-skeleton.c.
67+
* time/tst-strptime.c (main): Converted to ...
68+
(do_test): ... this.
69+
(TEST_FUNCTION): New macro.
70+
Include test-skeleton.c.
71+
* timezone/tst-timezone.c (main): Converted to ...
72+
(do_test): ... this.
73+
(TEST_FUNCTION): New macro.
74+
Include test-skeleton.c.
75+
176
2015-08-05 Zack Weinberg <[email protected]>
277

378
* misc/regexp.h: Update comments.

dirent/tst-seekdir.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
#include <dirent.h>
33
#include <stdlib.h>
44

5-
int
6-
main (int argc, char *argv[])
5+
static int
6+
do_test (void)
77
{
88
DIR * dirp;
99
long int save3 = 0;
@@ -76,3 +76,6 @@ main (int argc, char *argv[])
7676
closedir (dirp);
7777
return result;
7878
}
79+
80+
#define TEST_FUNCTION do_test ()
81+
#include "../test-skeleton.c"

elf/tst-dlmodcount.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ unload (const char *path, void *handle)
9292
dl_iterate_phdr (callback, (void *)(intptr_t) REMOVE);
9393
}
9494

95-
int
96-
main (int argc, char **argv)
95+
static int
96+
do_test (void)
9797
{
9898
void *handle1, *handle2;
9999

@@ -104,3 +104,6 @@ main (int argc, char **argv)
104104
unload ("globalmod1.so", handle2);
105105
return 0;
106106
}
107+
108+
#define TEST_FUNCTION do_test ()
109+
#include "../test-skeleton.c"

elf/tst-order-main.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22
#include <unistd.h>
33
#include <stdlib.h>
44

5-
int
6-
main( int argc, char *argv[] )
5+
static int
6+
do_test (void)
77
{
88
printf( "main\n" );
99
exit(EXIT_SUCCESS);
1010
}
11+
12+
#define TEST_FUNCTION do_test ()
13+
#include "../test-skeleton.c"

elf/tst-pie2.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,11 @@ init_g (void)
3131
g += 1;
3232
}
3333

34-
int
35-
main (int argc, char *argv[])
34+
static int
35+
do_test (void)
3636
{
3737
return 0;
3838
}
39+
40+
#define TEST_FUNCTION do_test ()
41+
#include "../test-skeleton.c"

inet/tst-ether_aton.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
#include <string.h>
33
#include <netinet/ether.h>
44

5-
int
6-
main (int argc, char *argv[])
5+
static int
6+
do_test (void)
77
{
88
struct ether_addr *valp, val;
99
int result, r;
@@ -55,3 +55,6 @@ main (int argc, char *argv[])
5555

5656
return result;
5757
}
58+
59+
#define TEST_FUNCTION do_test ()
60+
#include "../test-skeleton.c"

misc/tst-mntent.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
#include <string.h>
66

77

8-
int
9-
main (int argc, char *argv[])
8+
static int
9+
do_test (void)
1010
{
1111
int result = 0;
1212
struct mntent mef;
@@ -97,3 +97,6 @@ main (int argc, char *argv[])
9797

9898
return result;
9999
}
100+
101+
#define TEST_FUNCTION do_test ()
102+
#include "../test-skeleton.c"

misc/tst-tsearch.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,8 @@ mangle_tree (enum order how, enum action what, void **root, int lag)
248248
}
249249

250250

251-
int
252-
main (int argc, char **argv)
251+
static int
252+
do_test (void)
253253
{
254254
int total_error = 0;
255255
static char state[8] = { 1, 2, 3, 4, 5, 6, 7, 8 };
@@ -350,3 +350,6 @@ main (int argc, char **argv)
350350

351351
return total_error;
352352
}
353+
354+
#define TEST_FUNCTION do_test ()
355+
#include "../test-skeleton.c"

posix/tst-regexloc.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
#include <locale.h>
2424
#include <stdio.h>
2525

26-
int
27-
main (int argc, char *argv[])
26+
static int
27+
do_test (void)
2828
{
2929
regex_t re;
3030
regmatch_t mat[1];
@@ -44,3 +44,6 @@ main (int argc, char *argv[])
4444

4545
return res;
4646
}
47+
48+
#define TEST_FUNCTION do_test ()
49+
#include "../test-skeleton.c"

resolv/tst-aton.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ static struct tests
4444
};
4545

4646

47-
int
48-
main (int argc, char *argv[])
47+
static int
48+
do_test (void)
4949
{
5050
int result = 0;
5151
size_t cnt;
@@ -72,3 +72,6 @@ main (int argc, char *argv[])
7272

7373
return result;
7474
}
75+
76+
#define TEST_FUNCTION do_test ()
77+
#include "../test-skeleton.c"

0 commit comments

Comments
 (0)