From patchwork Mon Aug 3 16:14:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arjun Shankar X-Patchwork-Id: 503238 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 0D4B9140E0F for ; Tue, 4 Aug 2015 02:14:41 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b=Gi+c3Pdh; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=tZJ AntAT/o+XPJ7gPdkF1lIsT3WKPnpydkJyWENDvqQd23wSAy6nIgmqWCWDTirX3cJ +4jyBdu1L2CqI0hykUPv6FcNY0mp5V1TPHQFyhjgu4jXLXldrCLmOeqThEJKkQd/ 0hYM2rjqqcCXhOBU5DHTmNMJKJ71dp/VNuNFr2dA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type:content-transfer-encoding; s=default; bh=cfh7BabFM fyiKIHXue8AitCUTPo=; b=Gi+c3PdhuHElvy3AyxKZjRtCnQ4xLEQXJ+LYFZqhG ZAdJm4xsYodZKYNRzzB7JS2YFIo8Dfho4Orbk7OSqId9epLwt1wwImfmr0bbe4SZ R/Lw5wFxpQOJ6XlsIpY6D6CG2o0Y0gRdfiGYwUlAYzD7FsibriFd6NCM+W04cgqP xU= Received: (qmail 110598 invoked by alias); 3 Aug 2015 16:14:35 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 110573 invoked by uid 89); 3 Aug 2015 16:14:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.6 required=5.0 tests=BAYES_50, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-HELO: aloka.lostca.se Date: Mon, 3 Aug 2015 16:14:21 +0000 From: Arjun Shankar To: libc-alpha@sourceware.org Subject: [PATCH] Modify several tests to use test-skeleton.c Message-ID: <20150803161421.GA28622@aloka.lostca.se> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) 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 * 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. 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 #include -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 #include -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 #include -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 -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 #include -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 #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 5f23002..69592df 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 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 #include -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"