Source-Changes-HG archive

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

[src/trunk]: src/tests/fs Add testcase data argument to all fstest helper fun...



details:   https://anonhg.NetBSD.org/src/rev/bf5fbfc245c6
branches:  trunk
changeset: 756344:bf5fbfc245c6
user:      njoly <njoly%NetBSD.org@localhost>
date:      Tue Jul 13 15:50:31 2010 +0000

description:
Add testcase data argument to all fstest helper functions.
Needed by pooka for puffs fstest support.

diffstat:

 tests/fs/common/ext2fs.c     |  12 +++++++-----
 tests/fs/common/ffs.c        |  11 ++++++-----
 tests/fs/common/h_fsmacros.h |  10 +++++-----
 tests/fs/common/lfs.c        |  10 +++++-----
 tests/fs/common/msdosfs.c    |  12 +++++++-----
 tests/fs/common/sysvbfs.c    |  12 +++++++-----
 tests/fs/common/tmpfs.c      |  12 +++++++-----
 tests/fs/ffs/t_mount.c       |  10 +++++-----
 8 files changed, 49 insertions(+), 40 deletions(-)

diffs (truncated from 375 to 300 lines):

diff -r 11bdab3a6c1a -r bf5fbfc245c6 tests/fs/common/ext2fs.c
--- a/tests/fs/common/ext2fs.c  Tue Jul 13 15:38:15 2010 +0000
+++ b/tests/fs/common/ext2fs.c  Tue Jul 13 15:50:31 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ext2fs.c,v 1.3 2010/07/12 21:37:47 njoly Exp $ */
+/*     $NetBSD: ext2fs.c,v 1.4 2010/07/13 15:50:31 njoly Exp $ */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -32,6 +32,7 @@
 #include <sys/mount.h>
 #include <sys/stat.h>
 
+#include <atf-c.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -49,7 +50,8 @@
 };
 
 static int
-ext2fs_fstest_newfs(void **buf, const char *image, off_t size)
+ext2fs_fstest_newfs(const atf_tc_t *tc, void **buf, const char *image,
+    off_t size)
 {
        char cmd[1024];
        int res;
@@ -88,7 +90,7 @@
 }
 
 static int
-ext2fs_fstest_delfs(void *buf)
+ext2fs_fstest_delfs(const atf_tc_t *tc, void *buf)
 {
        int res;
        struct ext2fstestargs *args = buf;
@@ -107,7 +109,7 @@
 }
 
 static int
-ext2fs_fstest_mount(void *buf, const char *path, int flags)
+ext2fs_fstest_mount(const atf_tc_t *tc, void *buf, const char *path, int flags)
 {
        int res;
        struct ext2fstestargs *args = buf;
@@ -122,7 +124,7 @@
 }
 
 static int
-ext2fs_fstest_unmount(const char *path, int flags)
+ext2fs_fstest_unmount(const atf_tc_t *tc, const char *path, int flags)
 {
        int res;
 
diff -r 11bdab3a6c1a -r bf5fbfc245c6 tests/fs/common/ffs.c
--- a/tests/fs/common/ffs.c     Tue Jul 13 15:38:15 2010 +0000
+++ b/tests/fs/common/ffs.c     Tue Jul 13 15:50:31 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ffs.c,v 1.3 2010/07/12 21:37:47 njoly Exp $    */
+/*     $NetBSD: ffs.c,v 1.4 2010/07/13 15:50:31 njoly Exp $    */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -32,6 +32,7 @@
 #include <sys/mount.h>
 #include <sys/stat.h>
 
+#include <atf-c.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -49,7 +50,7 @@
 };
 
 static int
-ffs_fstest_newfs(void **buf, const char *image, off_t size)
+ffs_fstest_newfs(const atf_tc_t *tc, void **buf, const char *image, off_t size)
 {
        char cmd[1024];
        int res;
@@ -87,7 +88,7 @@
 }
 
 static int
-ffs_fstest_delfs(void *buf)
+ffs_fstest_delfs(const atf_tc_t *tc, void *buf)
 {
        int res;
        struct ffstestargs *args = buf;
@@ -106,7 +107,7 @@
 }
 
 static int
-ffs_fstest_mount(void *buf, const char *path, int flags)
+ffs_fstest_mount(const atf_tc_t *tc, void *buf, const char *path, int flags)
 {
        int res;
        struct ffstestargs *args = buf;
@@ -121,7 +122,7 @@
 }
 
 static int
-ffs_fstest_unmount(const char *path, int flags)
+ffs_fstest_unmount(const atf_tc_t *tc, const char *path, int flags)
 {
        int res;
 
diff -r 11bdab3a6c1a -r bf5fbfc245c6 tests/fs/common/h_fsmacros.h
--- a/tests/fs/common/h_fsmacros.h      Tue Jul 13 15:38:15 2010 +0000
+++ b/tests/fs/common/h_fsmacros.h      Tue Jul 13 15:50:31 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: h_fsmacros.h,v 1.8 2010/07/13 11:12:19 pooka Exp $     */
+/*     $NetBSD: h_fsmacros.h,v 1.9 2010/07/13 15:50:31 njoly Exp $     */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -60,14 +60,14 @@
   { \
     void *tmp; \
     atf_check_fstype(tc, type); \
-    if (fs##_fstest_newfs(&tmp, IMGNAME, IMGSIZE) != 0) \
+    if (fs##_fstest_newfs(tc, &tmp, IMGNAME, IMGSIZE) != 0) \
       atf_tc_fail("newfs failed"); \
-    if (fs##_fstest_mount(tmp, MNTNAME, 0) != 0) \
+    if (fs##_fstest_mount(tc, tmp, MNTNAME, 0) != 0) \
       atf_tc_fail("mount failed"); \
     func(tc,MNTNAME); \
-    if (fs##_fstest_unmount(MNTNAME, 0) != 0) \
+    if (fs##_fstest_unmount(tc, MNTNAME, 0) != 0) \
       atf_tc_fail("unmount failed"); \
-    if (fs##_fstest_delfs(tmp) != 0) \
+    if (fs##_fstest_delfs(tc, tmp) != 0) \
       atf_tc_fail("delfs failed"); \
   }
 
diff -r 11bdab3a6c1a -r bf5fbfc245c6 tests/fs/common/lfs.c
--- a/tests/fs/common/lfs.c     Tue Jul 13 15:38:15 2010 +0000
+++ b/tests/fs/common/lfs.c     Tue Jul 13 15:50:31 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lfs.c,v 1.5 2010/07/12 21:37:47 njoly Exp $    */
+/*     $NetBSD: lfs.c,v 1.6 2010/07/13 15:50:31 njoly Exp $    */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -50,7 +50,7 @@
 };
 
 static int
-lfs_fstest_newfs(void **buf, const char *image, off_t size)
+lfs_fstest_newfs(const atf_tc_t *tc, void **buf, const char *image, off_t size)
 {
        char cmd[1024];
        int res;
@@ -89,7 +89,7 @@
 }
 
 static int
-lfs_fstest_delfs(void *buf)
+lfs_fstest_delfs(const atf_tc_t *tc, void *buf)
 {
        int res;
        struct lfstestargs *args = buf;
@@ -108,7 +108,7 @@
 }
 
 static int
-lfs_fstest_mount(void *buf, const char *path, int flags)
+lfs_fstest_mount(const atf_tc_t *tc, void *buf, const char *path, int flags)
 {
        int res;
        struct lfstestargs *args = buf;
@@ -125,7 +125,7 @@
 }
 
 static int
-lfs_fstest_unmount(const char *path, int flags)
+lfs_fstest_unmount(const atf_tc_t *tc, const char *path, int flags)
 {
        int res;
 
diff -r 11bdab3a6c1a -r bf5fbfc245c6 tests/fs/common/msdosfs.c
--- a/tests/fs/common/msdosfs.c Tue Jul 13 15:38:15 2010 +0000
+++ b/tests/fs/common/msdosfs.c Tue Jul 13 15:50:31 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msdosfs.c,v 1.3 2010/07/12 21:37:47 njoly Exp $        */
+/*     $NetBSD: msdosfs.c,v 1.4 2010/07/13 15:50:31 njoly Exp $        */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -32,6 +32,7 @@
 #include <sys/mount.h>
 #include <sys/stat.h>
 
+#include <atf-c.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -49,7 +50,8 @@
 };
 
 static int
-msdosfs_fstest_newfs(void **buf, const char *image, off_t size)
+msdosfs_fstest_newfs(const atf_tc_t *tc, void **buf, const char *image,
+    off_t size)
 {
        char cmd[1024];
        int res;
@@ -88,7 +90,7 @@
 }
 
 static int
-msdosfs_fstest_delfs(void *buf)
+msdosfs_fstest_delfs(const atf_tc_t *tc, void *buf)
 {
        int res;
        struct msdosfstestargs *args = buf;
@@ -107,7 +109,7 @@
 }
 
 static int
-msdosfs_fstest_mount(void *buf, const char *path, int flags)
+msdosfs_fstest_mount(const atf_tc_t *tc, void *buf, const char *path, int flags)
 {
        int res;
        struct msdosfstestargs *args = buf;
@@ -122,7 +124,7 @@
 }
 
 static int
-msdosfs_fstest_unmount(const char *path, int flags)
+msdosfs_fstest_unmount(const atf_tc_t *tc, const char *path, int flags)
 {
        int res;
 
diff -r 11bdab3a6c1a -r bf5fbfc245c6 tests/fs/common/sysvbfs.c
--- a/tests/fs/common/sysvbfs.c Tue Jul 13 15:38:15 2010 +0000
+++ b/tests/fs/common/sysvbfs.c Tue Jul 13 15:50:31 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sysvbfs.c,v 1.3 2010/07/12 21:37:47 njoly Exp $        */
+/*     $NetBSD: sysvbfs.c,v 1.4 2010/07/13 15:50:31 njoly Exp $        */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -32,6 +32,7 @@
 #include <sys/mount.h>
 #include <sys/stat.h>
 
+#include <atf-c.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -49,7 +50,8 @@
 };
 
 static int
-sysvbfs_fstest_newfs(void **buf, const char *image, off_t size)
+sysvbfs_fstest_newfs(const atf_tc_t *tc, void **buf, const char *image,
+    off_t size)
 {
        char cmd[1024];
        int res;
@@ -88,7 +90,7 @@
 }
 
 static int
-sysvbfs_fstest_delfs(void *buf)
+sysvbfs_fstest_delfs(const atf_tc_t *tc, void *buf)
 {
        int res;
        struct sysvbfstestargs *args = buf;
@@ -107,7 +109,7 @@
 }
 
 static int
-sysvbfs_fstest_mount(void *buf, const char *path, int flags)
+sysvbfs_fstest_mount(const atf_tc_t *tc, void *buf, const char *path, int flags)
 {
        int res;
        struct sysvbfstestargs *args = buf;
@@ -122,7 +124,7 @@
 }
 
 static int
-sysvbfs_fstest_unmount(const char *path, int flags)
+sysvbfs_fstest_unmount(const atf_tc_t *tc, const char *path, int flags)
 {
        int res;
 
diff -r 11bdab3a6c1a -r bf5fbfc245c6 tests/fs/common/tmpfs.c
--- a/tests/fs/common/tmpfs.c   Tue Jul 13 15:38:15 2010 +0000
+++ b/tests/fs/common/tmpfs.c   Tue Jul 13 15:50:31 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tmpfs.c,v 1.3 2010/07/12 21:37:47 njoly Exp $  */
+/*     $NetBSD: tmpfs.c,v 1.4 2010/07/13 15:50:31 njoly Exp $  */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -32,6 +32,7 @@
 #include <sys/mount.h>
 #include <sys/stat.h>



Home | Main Index | Thread Index | Old Index