From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id F0FC11381F3 for ; Mon, 24 Dec 2012 23:58:30 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BE7EB21C01C; Mon, 24 Dec 2012 23:58:22 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 1113921C004 for ; Mon, 24 Dec 2012 23:58:21 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id E179A33D88F for ; Mon, 24 Dec 2012 23:58:20 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 72284E543C for ; Mon, 24 Dec 2012 23:58:19 +0000 (UTC) From: "Mike Frysinger" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" Message-ID: <1356392915.5daa8f40978f03ea1ae96f2dff48e7219ad6fff4.vapier@gentoo> Subject: [gentoo-commits] proj/sandbox:master commit in: tests/ X-VCS-Repository: proj/sandbox X-VCS-Files: tests/access-0.c tests/faccessat-0.c tests/fchmodat-0.c tests/fchownat-0.c tests/fopen-0.c tests/fopen64-0.c tests/futimesat-0.c tests/link-0.c tests/linkat-0.c tests/lutimes-0.c tests/mkostemp-0.c tests/mkostemp64-0.c tests/mkostemps-0.c tests/mkostemps64-0.c tests/open-0.c tests/open64-0.c tests/openat-0.c tests/openat64-0.c tests/rename-0.c tests/renameat-0.c tests/symlink-0.c tests/symlinkat-0.c tests/test-skel-0.c tests/truncate-0.c tests/truncate64-0.c tests/unlinkat-0.c tests/utime-0.c tests/utimensat-0.c tests/utimes-0.c X-VCS-Directories: tests/ X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: 5daa8f40978f03ea1ae96f2dff48e7219ad6fff4 X-VCS-Branch: master Date: Mon, 24 Dec 2012 23:58:19 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: c963125c-e822-4371-9bf7-71299f5bcac0 X-Archives-Hash: b92d11cd4f0b53dfdca106e061093cb5 commit: 5daa8f40978f03ea1ae96f2dff48e7219ad6fff4 Author: Mike Frysinger gentoo org> AuthorDate: Mon Dec 24 23:33:33 2012 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Mon Dec 24 23:48:35 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/sandbox.git;a=commit;h=5daa8f40 tests: expand usage strings Makes it easier to quickly figure out how to run a helper test without having to resort to existing usage or the code itself. Signed-off-by: Mike Frysinger gentoo.org> --- tests/access-0.c | 8 ++------ tests/faccessat-0.c | 5 ++--- tests/fchmodat-0.c | 2 +- tests/fchownat-0.c | 2 +- tests/fopen-0.c | 2 +- tests/fopen64-0.c | 2 +- tests/futimesat-0.c | 2 +- tests/link-0.c | 2 +- tests/linkat-0.c | 2 +- tests/lutimes-0.c | 2 +- tests/mkostemp-0.c | 2 +- tests/mkostemp64-0.c | 2 +- tests/mkostemps-0.c | 2 +- tests/mkostemps64-0.c | 2 +- tests/open-0.c | 2 +- tests/open64-0.c | 2 +- tests/openat-0.c | 2 +- tests/openat64-0.c | 2 +- tests/rename-0.c | 2 +- tests/renameat-0.c | 2 +- tests/symlink-0.c | 2 +- tests/symlinkat-0.c | 2 +- tests/test-skel-0.c | 41 ++++++++++++++++++++++++++++++++++++++++- tests/truncate-0.c | 2 +- tests/truncate64-0.c | 2 +- tests/unlinkat-0.c | 2 +- tests/utime-0.c | 2 +- tests/utimensat-0.c | 2 +- tests/utimes-0.c | 2 +- 29 files changed, 70 insertions(+), 36 deletions(-) diff --git a/tests/access-0.c b/tests/access-0.c index 91507e0..fd03177 100644 --- a/tests/access-0.c +++ b/tests/access-0.c @@ -3,17 +3,13 @@ #define FUNC_STR "\"%s\", %x" #define FUNC_IMP file, mode #define ARG_CNT 2 -#define ARG_USE " " +#define ARG_USE " " #define process_args() \ s = argv[i++]; \ const char *file = f_get_file(s); \ \ s = argv[i++]; \ - int mode = 0; \ - if (strchr(s, 'r')) mode |= R_OK; \ - if (strchr(s, 'w')) mode |= W_OK; \ - if (strchr(s, 'x')) mode |= X_OK; \ - if (strchr(s, 'f')) mode = F_OK; + int mode = access_mode(s); #include "test-skel-0.c" diff --git a/tests/faccessat-0.c b/tests/faccessat-0.c index e348984..98ea2ec 100644 --- a/tests/faccessat-0.c +++ b/tests/faccessat-0.c @@ -4,7 +4,7 @@ #define FUNC_STR "%i, \"%s\", %x, %x" #define FUNC_IMP dirfd, file, mode, flags #define ARG_CNT 4 -#define ARG_USE " " +#define ARG_USE " " #define process_args() \ s = argv[i++]; \ @@ -14,8 +14,7 @@ const char *file = f_get_file(s); \ \ s = argv[i++]; \ - int mode = 0; \ - sscanf(s, "%i", &mode); \ + int mode = access_mode(s); \ \ s = argv[i++]; \ int flags = at_get_flags(s); diff --git a/tests/fchmodat-0.c b/tests/fchmodat-0.c index 98ffe66..fe77a35 100644 --- a/tests/fchmodat-0.c +++ b/tests/fchmodat-0.c @@ -4,7 +4,7 @@ #define FUNC_STR "%i, \"%s\", %o, %x" #define FUNC_IMP dirfd, file, mode, flags #define ARG_CNT 4 -#define ARG_USE " " +#define ARG_USE " " #define process_args() \ s = argv[i++]; \ diff --git a/tests/fchownat-0.c b/tests/fchownat-0.c index a168e75..e47d7f3 100644 --- a/tests/fchownat-0.c +++ b/tests/fchownat-0.c @@ -4,7 +4,7 @@ #define FUNC_STR "%i, \"%s\", %i, %i, %x" #define FUNC_IMP dirfd, file, uid, gid, flags #define ARG_CNT 5 -#define ARG_USE " " +#define ARG_USE " " #define process_args() \ s = argv[i++]; \ diff --git a/tests/fopen-0.c b/tests/fopen-0.c index abf4965..e8702bf 100644 --- a/tests/fopen-0.c +++ b/tests/fopen-0.c @@ -3,7 +3,7 @@ #define FUNC_STR "\"%s\", \"%s\"" #define FUNC_IMP file, mode #define ARG_CNT 2 -#define ARG_USE " " +#define ARG_USE " " #define process_args() \ s = argv[i++]; \ diff --git a/tests/fopen64-0.c b/tests/fopen64-0.c index e7aa673..78c0fa7 100644 --- a/tests/fopen64-0.c +++ b/tests/fopen64-0.c @@ -4,7 +4,7 @@ #define FUNC_STR "\"%s\", \"%s\"" #define FUNC_IMP file, mode #define ARG_CNT 2 -#define ARG_USE " " +#define ARG_USE " " #define process_args() \ s = argv[i++]; \ diff --git a/tests/futimesat-0.c b/tests/futimesat-0.c index f710e8f..6d2ae43 100644 --- a/tests/futimesat-0.c +++ b/tests/futimesat-0.c @@ -4,7 +4,7 @@ #define FUNC_STR "%i, \"%s\", %p" #define FUNC_IMP dirfd, file, times #define ARG_CNT 3 -#define ARG_USE " " +#define ARG_USE " " #define process_args() \ s = argv[i++]; \ diff --git a/tests/link-0.c b/tests/link-0.c index f5e4f88..2c7b66c 100644 --- a/tests/link-0.c +++ b/tests/link-0.c @@ -3,7 +3,7 @@ #define FUNC_STR "\"%s\", \"%s\"" #define FUNC_IMP oldpath, newpath #define ARG_CNT 2 -#define ARG_USE " " +#define ARG_USE "(old) (new)" #define process_args() \ s = argv[i++]; \ diff --git a/tests/linkat-0.c b/tests/linkat-0.c index 8c1af52..0f729bb 100644 --- a/tests/linkat-0.c +++ b/tests/linkat-0.c @@ -4,7 +4,7 @@ #define FUNC_STR "%i, \"%s\", %i, \"%s\", %x" #define FUNC_IMP olddirfd, oldpath, newdirfd, newpath, flags #define ARG_CNT 5 -#define ARG_USE " " +#define ARG_USE "(old) (old) (new) (new) " #define process_args() \ s = argv[i++]; \ diff --git a/tests/lutimes-0.c b/tests/lutimes-0.c index 6b7c2e3..1037438 100644 --- a/tests/lutimes-0.c +++ b/tests/lutimes-0.c @@ -4,7 +4,7 @@ #define FUNC_STR "\"%s\", %p" #define FUNC_IMP file, times #define ARG_CNT 2 -#define ARG_USE " " +#define ARG_USE " " #define process_args() \ s = argv[i++]; \ diff --git a/tests/mkostemp-0.c b/tests/mkostemp-0.c index 7445126..65cf8c2 100644 --- a/tests/mkostemp-0.c +++ b/tests/mkostemp-0.c @@ -4,7 +4,7 @@ #define FUNC_STR "\"%s\", %#x" #define FUNC_IMP template, flags #define ARG_CNT 2 -#define ARG_USE "