Module Name:    src
Committed By:   njoly
Date:           Mon Jul 12 21:05:20 UTC 2010

Modified Files:
        src/tests/fs/common: h_fsmacros.h
        src/tests/fs/vfs: t_rmdirrace.c

Log Message:
Pass down the test case data to the test function, to be able to use
meta-data informations such as srcdir. Requested by pooka.

While here remove fstype argument, and define it as a custom meta-data
(X-fs.type) instead.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/fs/common/h_fsmacros.h
cvs rdiff -u -r1.4 -r1.5 src/tests/fs/vfs/t_rmdirrace.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/common/h_fsmacros.h
diff -u src/tests/fs/common/h_fsmacros.h:1.5 src/tests/fs/common/h_fsmacros.h:1.6
--- src/tests/fs/common/h_fsmacros.h:1.5	Fri Jul  9 14:30:53 2010
+++ src/tests/fs/common/h_fsmacros.h	Mon Jul 12 21:05:19 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: h_fsmacros.h,v 1.5 2010/07/09 14:30:53 njoly Exp $	*/
+/*	$NetBSD: h_fsmacros.h,v 1.6 2010/07/12 21:05:19 njoly Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -54,6 +54,7 @@
   { \
     atf_tc_set_md_var(tc, "descr", type " test for " desc); \
     atf_tc_set_md_var(tc, "use.fs", "true"); \
+    atf_tc_set_md_var(tc, "X-fs.type", type); \
   } \
   ATF_TC_BODY(fs##_##func,tc) \
   { \
@@ -63,7 +64,7 @@
       atf_tc_fail("newfs failed"); \
     if (fs##_mount(tmp, MNTNAME, 0) != 0) \
       atf_tc_fail("mount failed"); \
-    func(type,MNTNAME); \
+    func(tc,MNTNAME); \
     if (fs##_unmount(MNTNAME, 0) != 0) \
       atf_tc_fail("unmount failed"); \
     if (fs##_delfs(tmp) != 0) \

Index: src/tests/fs/vfs/t_rmdirrace.c
diff -u src/tests/fs/vfs/t_rmdirrace.c:1.4 src/tests/fs/vfs/t_rmdirrace.c:1.5
--- src/tests/fs/vfs/t_rmdirrace.c:1.4	Fri Jul  9 14:30:53 2010
+++ src/tests/fs/vfs/t_rmdirrace.c	Mon Jul 12 21:05:20 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_rmdirrace.c,v 1.4 2010/07/09 14:30:53 njoly Exp $	*/
+/*	$NetBSD: t_rmdirrace.c,v 1.5 2010/07/12 21:05:20 njoly Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -62,11 +62,14 @@
 }
 
 static void
-race(const char *type, const char *path)
+race(const atf_tc_t *tc, const char *path)
 {
+	const char *type;
 	int res, fd, quit;
 	pthread_t th1, th2;
 
+	type = atf_tc_get_md_var(tc, "X-fs.type");
+
 	if (FSTYPE_LFS(type))
 		atf_tc_expect_signal(-1, "PR kern/43582");
 	if (FSTYPE_SYSVBFS(type))

Reply via email to