Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/lib/libc/c063 Remove unnecessary cleanup routines.



details:   https://anonhg.NetBSD.org/src/rev/476029645b69
branches:  trunk
changeset: 785515:476029645b69
user:      jmmv <jmmv%NetBSD.org@localhost>
date:      Sun Mar 17 04:46:06 2013 +0000

description:
Remove unnecessary cleanup routines.

diffstat:

 tests/lib/libc/c063/t_faccessat.c  |  74 ++++--------------------------------
 tests/lib/libc/c063/t_fchmodat.c   |  74 ++++--------------------------------
 tests/lib/libc/c063/t_fchownat.c   |  73 ++++--------------------------------
 tests/lib/libc/c063/t_fstatat.c    |  75 ++++---------------------------------
 tests/lib/libc/c063/t_linkat.c     |  74 ++++---------------------------------
 tests/lib/libc/c063/t_mkdirat.c    |  46 +++--------------------
 tests/lib/libc/c063/t_mkfifoat.c   |  46 +++--------------------
 tests/lib/libc/c063/t_mknodat.c    |  46 +++--------------------
 tests/lib/libc/c063/t_o_search.c   |  74 ++++--------------------------------
 tests/lib/libc/c063/t_openat.c     |  65 ++++----------------------------
 tests/lib/libc/c063/t_readlinkat.c |  60 +++--------------------------
 tests/lib/libc/c063/t_renameat.c   |  49 +++---------------------
 tests/lib/libc/c063/t_symlinkat.c  |  50 +++----------------------
 tests/lib/libc/c063/t_unlinkat.c   |  73 ++++--------------------------------
 tests/lib/libc/c063/t_utimensat.c  |  73 ++++--------------------------------
 15 files changed, 116 insertions(+), 836 deletions(-)

diffs (truncated from 2268 to 300 lines):

diff -r bbb3e538cca0 -r 476029645b69 tests/lib/libc/c063/t_faccessat.c
--- a/tests/lib/libc/c063/t_faccessat.c Sun Mar 17 04:45:46 2013 +0000
+++ b/tests/lib/libc/c063/t_faccessat.c Sun Mar 17 04:46:06 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_faccessat.c,v 1.1 2012/11/18 17:41:54 manu Exp $ */
+/*     $NetBSD: t_faccessat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $ */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_faccessat.c,v 1.1 2012/11/18 17:41:54 manu Exp $");
+__RCSID("$NetBSD: t_faccessat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $");
 
 #include <atf-c.h>
 #include <errno.h>
@@ -48,12 +48,11 @@
 #define BASELINK "symlink"
 #define FILEERR "dir/faccessaterr"
 
-ATF_TC_WITH_CLEANUP(faccessat_fd);
+ATF_TC(faccessat_fd);
 ATF_TC_HEAD(faccessat_fd, tc)
 {
        atf_tc_set_md_var(tc, "descr", "See that faccessat works with fd");
 }
-
 ATF_TC_BODY(faccessat_fd, tc)
 {
        int dfd;
@@ -68,20 +67,12 @@
        ATF_REQUIRE(close(dfd) == 0);
 }
 
-ATF_TC_CLEANUP(faccessat_fd, tc)
-{
-       (void)unlink(FILE);
-       (void)unlink(FILEERR);
-       (void)rmdir(DIR);
-}
-
-ATF_TC_WITH_CLEANUP(faccessat_fdcwd);
+ATF_TC(faccessat_fdcwd);
 ATF_TC_HEAD(faccessat_fdcwd, tc)
 {
        atf_tc_set_md_var(tc, "descr", 
                          "See that faccessat works with fd as AT_FDCWD");
 }
-
 ATF_TC_BODY(faccessat_fdcwd, tc)
 {
        int fd;
@@ -94,39 +85,23 @@
        ATF_REQUIRE(faccessat(AT_FDCWD, BASEFILE, F_OK, 0) == 0);
 }
 
-ATF_TC_CLEANUP(faccessat_fdcwd, tc)
-{
-       (void)unlink(FILE);
-       (void)unlink(FILEERR);
-       (void)rmdir(DIR);
-}
-
-ATF_TC_WITH_CLEANUP(faccessat_fdcwderr);
+ATF_TC(faccessat_fdcwderr);
 ATF_TC_HEAD(faccessat_fdcwderr, tc)
 {
        atf_tc_set_md_var(tc, "descr", 
                  "See that faccessat fails with fd as AT_FDCWD and bad path");
 }
-
 ATF_TC_BODY(faccessat_fdcwderr, tc)
 {
        ATF_REQUIRE(mkdir(DIR, 0755) == 0);
        ATF_REQUIRE(faccessat(AT_FDCWD, FILEERR, F_OK, 0) == -1);
 }
 
-ATF_TC_CLEANUP(faccessat_fdcwderr, tc)
-{
-       (void)unlink(FILE);
-       (void)unlink(FILEERR);
-       (void)rmdir(DIR);
-}
-
-ATF_TC_WITH_CLEANUP(faccessat_fderr1);
+ATF_TC(faccessat_fderr1);
 ATF_TC_HEAD(faccessat_fderr1, tc)
 {
        atf_tc_set_md_var(tc, "descr", "See that faccessat fail with bad path");
 }
-
 ATF_TC_BODY(faccessat_fderr1, tc)
 {
        int dfd;
@@ -135,22 +110,13 @@
        ATF_REQUIRE((dfd = open(DIR, O_RDONLY, 0)) != -1);
        ATF_REQUIRE(faccessat(dfd, FILEERR, F_OK, 0) == -1);
        ATF_REQUIRE(close(dfd) == 0);
-       
 }
 
-ATF_TC_CLEANUP(faccessat_fderr1, tc)
-{
-       (void)unlink(FILE);
-       (void)unlink(FILEERR);
-       (void)rmdir(DIR);
-}
-
-ATF_TC_WITH_CLEANUP(faccessat_fderr2);
+ATF_TC(faccessat_fderr2);
 ATF_TC_HEAD(faccessat_fderr2, tc)
 {
        atf_tc_set_md_var(tc, "descr", "See that faccessat fails with bad fdat");
 }
-
 ATF_TC_BODY(faccessat_fderr2, tc)
 {
        int dfd;
@@ -166,19 +132,11 @@
        ATF_REQUIRE(close(dfd) == 0);
 }
 
-ATF_TC_CLEANUP(faccessat_fderr2, tc)
-{
-       (void)unlink(FILE);
-       (void)unlink(FILEERR);
-       (void)rmdir(DIR);
-}
-
-ATF_TC_WITH_CLEANUP(faccessat_fderr3);
+ATF_TC(faccessat_fderr3);
 ATF_TC_HEAD(faccessat_fderr3, tc)
 {
        atf_tc_set_md_var(tc, "descr", "See that faccessat fails with fd as -1");
 }
-
 ATF_TC_BODY(faccessat_fderr3, tc)
 {
        int fd;
@@ -190,19 +148,11 @@
        ATF_REQUIRE(faccessat(-1, FILE, F_OK, 0) == -1);
 }
 
-ATF_TC_CLEANUP(faccessat_fderr3, tc)
-{
-       (void)unlink(FILE);
-       (void)unlink(FILEERR);
-       (void)rmdir(DIR);
-}
-
-ATF_TC_WITH_CLEANUP(faccessat_fdlink);
+ATF_TC(faccessat_fdlink);
 ATF_TC_HEAD(faccessat_fdlink, tc)
 {
        atf_tc_set_md_var(tc, "descr", "See that faccessat works on symlink");
 }
-
 ATF_TC_BODY(faccessat_fdlink, tc)
 {
        int dfd;
@@ -220,12 +170,6 @@
        ATF_REQUIRE(close(dfd) == 0);
 }
 
-ATF_TC_CLEANUP(faccessat_fdlink, tc)
-{
-       (void)unlink(LINK);
-       (void)rmdir(DIR);
-}
-
 ATF_TP_ADD_TCS(tp)
 {
 
diff -r bbb3e538cca0 -r 476029645b69 tests/lib/libc/c063/t_fchmodat.c
--- a/tests/lib/libc/c063/t_fchmodat.c  Sun Mar 17 04:45:46 2013 +0000
+++ b/tests/lib/libc/c063/t_fchmodat.c  Sun Mar 17 04:46:06 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_fchmodat.c,v 1.1 2012/11/18 17:41:54 manu Exp $ */
+/*     $NetBSD: t_fchmodat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $ */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_fchmodat.c,v 1.1 2012/11/18 17:41:54 manu Exp $");
+__RCSID("$NetBSD: t_fchmodat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $");
 
 #include <atf-c.h>
 #include <errno.h>
@@ -48,12 +48,11 @@
 #define BASELINK "symlink"
 #define FILEERR "dir/fchmodaterr"
 
-ATF_TC_WITH_CLEANUP(fchmodat_fd);
+ATF_TC(fchmodat_fd);
 ATF_TC_HEAD(fchmodat_fd, tc)
 {
        atf_tc_set_md_var(tc, "descr", "See that fchmodat works with fd");
 }
-
 ATF_TC_BODY(fchmodat_fd, tc)
 {
        int dfd;
@@ -72,20 +71,12 @@
        ATF_REQUIRE(st.st_mode = 0600);
 }
 
-ATF_TC_CLEANUP(fchmodat_fd, tc)
-{
-       (void)unlink(FILE);
-       (void)unlink(FILEERR);
-       (void)rmdir(DIR);
-}
-
-ATF_TC_WITH_CLEANUP(fchmodat_fdcwd);
+ATF_TC(fchmodat_fdcwd);
 ATF_TC_HEAD(fchmodat_fdcwd, tc)
 {
        atf_tc_set_md_var(tc, "descr", 
                          "See that fchmodat works with fd as AT_FDCWD");
 }
-
 ATF_TC_BODY(fchmodat_fdcwd, tc)
 {
        int fd;
@@ -102,39 +93,23 @@
        ATF_REQUIRE(st.st_mode = 0600);
 }
 
-ATF_TC_CLEANUP(fchmodat_fdcwd, tc)
-{
-       (void)unlink(FILE);
-       (void)unlink(FILEERR);
-       (void)rmdir(DIR);
-}
-
-ATF_TC_WITH_CLEANUP(fchmodat_fdcwderr);
+ATF_TC(fchmodat_fdcwderr);
 ATF_TC_HEAD(fchmodat_fdcwderr, tc)
 {
        atf_tc_set_md_var(tc, "descr", 
                  "See that fchmodat fails with fd as AT_FDCWD and bad path");
 }
-
 ATF_TC_BODY(fchmodat_fdcwderr, tc)
 {
        ATF_REQUIRE(mkdir(DIR, 0755) == 0);
        ATF_REQUIRE(fchmodat(AT_FDCWD, FILEERR, 0600, 0) == -1);
 }
 
-ATF_TC_CLEANUP(fchmodat_fdcwderr, tc)
-{
-       (void)unlink(FILE);
-       (void)unlink(FILEERR);
-       (void)rmdir(DIR);
-}
-
-ATF_TC_WITH_CLEANUP(fchmodat_fderr1);
+ATF_TC(fchmodat_fderr1);
 ATF_TC_HEAD(fchmodat_fderr1, tc)
 {
        atf_tc_set_md_var(tc, "descr", "See that fchmodat fail with bad path");
 }
-
 ATF_TC_BODY(fchmodat_fderr1, tc)
 {
        int dfd;
@@ -145,19 +120,11 @@
        ATF_REQUIRE(close(dfd) == 0);
 }
 
-ATF_TC_CLEANUP(fchmodat_fderr1, tc)
-{
-       (void)unlink(FILE);
-       (void)unlink(FILEERR);
-       (void)rmdir(DIR);
-}
-
-ATF_TC_WITH_CLEANUP(fchmodat_fderr2);
+ATF_TC(fchmodat_fderr2);
 ATF_TC_HEAD(fchmodat_fderr2, tc)
 {
        atf_tc_set_md_var(tc, "descr", "See that fchmodat fails with bad fdat");
 }
-
 ATF_TC_BODY(fchmodat_fderr2, tc)
 {
        int dfd;
@@ -173,19 +140,11 @@
        ATF_REQUIRE(close(dfd) == 0);
 }
 
-ATF_TC_CLEANUP(fchmodat_fderr2, tc)
-{
-       (void)unlink(FILE);
-       (void)unlink(FILEERR);



Home | Main Index | Thread Index | Old Index