Source-Changes-HG archive

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

[src/trunk]: src Move the mkdir(2) test to the right place.



details:   https://anonhg.NetBSD.org/src/rev/831289e63438
branches:  trunk
changeset: 770377:831289e63438
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Sat Oct 15 06:26:33 2011 +0000

description:
Move the mkdir(2) test to the right place.

diffstat:

 distrib/sets/lists/tests/mi  |   8 ++-
 tests/kernel/Makefile        |   3 +-
 tests/kernel/t_mkdir.c       |  84 --------------------------------------------
 tests/lib/libc/sys/Makefile  |   3 +-
 tests/lib/libc/sys/t_mkdir.c |  84 ++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 92 insertions(+), 90 deletions(-)

diffs (253 lines):

diff -r 10abdfa360ab -r 831289e63438 distrib/sets/lists/tests/mi
--- a/distrib/sets/lists/tests/mi       Sat Oct 15 06:17:02 2011 +0000
+++ b/distrib/sets/lists/tests/mi       Sat Oct 15 06:26:33 2011 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.403 2011/10/15 06:17:02 jruoho Exp $
+# $NetBSD: mi,v 1.404 2011/10/15 06:26:34 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -324,7 +324,7 @@
 ./usr/libdata/debug/usr/tests/kernel/t_filedesc.debug                  tests-kernel-tests      debug,atf
 ./usr/libdata/debug/usr/tests/kernel/t_lock.debug                      tests-kernel-tests      debug,atf
 ./usr/libdata/debug/usr/tests/kernel/t_lwpctl.debug                    tests-kernel-tests      debug,atf
-./usr/libdata/debug/usr/tests/kernel/t_mkdir.debug                     tests-kernel-tests      debug,atf
+./usr/libdata/debug/usr/tests/kernel/t_mkdir.debug                     tests-obsolete          obsolete
 ./usr/libdata/debug/usr/tests/kernel/t_pipe.debug                      tests-obsolete          obsolete
 ./usr/libdata/debug/usr/tests/kernel/t_poll3w.debug                    tests-kernel-tests      debug,atf
 ./usr/libdata/debug/usr/tests/kernel/t_pollts.debug                    tests-obsolete          obsolete
@@ -504,6 +504,7 @@
 ./usr/libdata/debug/usr/tests/lib/libc/sys/t_kill.debug                        tests-lib-debug         debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/sys/t_link.debug                        tests-lib-debug         debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/sys/t_mincore.debug             tests-lib-debug         debug,atf
+./usr/libdata/debug/usr/tests/lib/libc/sys/t_mkdir.debug               tests-lib-debug         debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/sys/t_mkfifo.debug              tests-lib-debug         debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/sys/t_mknod.debug               tests-lib-debug         debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/sys/t_mmap.debug                        tests-lib-debug         debug,atf
@@ -1849,7 +1850,7 @@
 ./usr/tests/kernel/t_filedesc                  tests-kernel-tests              atf
 ./usr/tests/kernel/t_lock                      tests-kernel-tests              atf
 ./usr/tests/kernel/t_lwpctl                    tests-kernel-tests              atf
-./usr/tests/kernel/t_mkdir                     tests-kernel-tests              atf
+./usr/tests/kernel/t_mkdir                     tests-obsolete                  obsolete
 ./usr/tests/kernel/t_pipe                      tests-obsolete                  obsolete
 ./usr/tests/kernel/t_poll3w                    tests-kernel-tests              atf
 ./usr/tests/kernel/t_pollts                    tests-obsolete                  obsolete
@@ -2118,6 +2119,7 @@
 ./usr/tests/lib/libc/sys/t_kill                        tests-lib-tests         atf
 ./usr/tests/lib/libc/sys/t_link                        tests-lib-tests         atf
 ./usr/tests/lib/libc/sys/t_mincore             tests-lib-tests         atf
+./usr/tests/lib/libc/sys/t_mkdir               tests-lib-tests         atf
 ./usr/tests/lib/libc/sys/t_mkfifo              tests-lib-tests         atf
 ./usr/tests/lib/libc/sys/t_mknod               tests-lib-tests         atf
 ./usr/tests/lib/libc/sys/t_mmap                        tests-lib-tests         atf
diff -r 10abdfa360ab -r 831289e63438 tests/kernel/Makefile
--- a/tests/kernel/Makefile     Sat Oct 15 06:17:02 2011 +0000
+++ b/tests/kernel/Makefile     Sat Oct 15 06:26:33 2011 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.15 2011/10/15 06:17:02 jruoho Exp $
+# $NetBSD: Makefile,v 1.16 2011/10/15 06:26:33 jruoho Exp $
 
 NOMAN=         # defined
 
@@ -10,7 +10,6 @@
 
 TESTS_C=       t_lock
 TESTS_C+=      t_lwpctl
-TESTS_C+=      t_mkdir
 TESTS_C+=      t_poll3w
 TESTS_C+=      t_pty
 TESTS_C+=      t_rnd
diff -r 10abdfa360ab -r 831289e63438 tests/kernel/t_mkdir.c
--- a/tests/kernel/t_mkdir.c    Sat Oct 15 06:17:02 2011 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-/* $NetBSD: t_mkdir.c,v 1.3 2010/11/07 17:51:19 jmmv Exp $ */
-
-/*-
- * Copyright (c) 2008 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Jason R. Thorpe.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__COPYRIGHT("@(#) Copyright (c) 2008\
- The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_mkdir.c,v 1.3 2010/11/07 17:51:19 jmmv Exp $");
-
-#include <sys/stat.h>
-
-#include <stdio.h>
-#include <unistd.h>
-
-#include <atf-c.h>
-
-#include "../h_macros.h"
-
-ATF_TC(mkdir);
-ATF_TC_HEAD(mkdir, tc)
-{
-       atf_tc_set_md_var(tc, "descr", "Checks mkdir(2)");
-}
-ATF_TC_BODY(mkdir, tc)
-{
-       const char *tests[] = {
-               /*
-                * IEEE 1003.1 second ed. 2.2.2.78:
-                *
-                * If the pathname refers to a directory, it may also have
-                * one or more trailing slashes.  Multiple successive slashes
-                * are considered to be the same as one slash.
-                */
-               "dir1/",
-               "dir2//",
-
-               NULL,
-       };
-       const char **test;
-
-       for (test = &tests[0]; *test != NULL; ++test) {
-               (void)printf("Checking \"%s\"\n", *test);
-               (void)rmdir(*test);
-
-               RL(mkdir(*test, 0777));
-               RL(rename(*test, "foo"));
-               RL(rename("foo/", *test));
-               RL(rmdir(*test));
-       }
-}
-
-ATF_TP_ADD_TCS(tp)
-{
-       ATF_TP_ADD_TC(tp, mkdir);
-
-       return atf_no_error();
-}
diff -r 10abdfa360ab -r 831289e63438 tests/lib/libc/sys/Makefile
--- a/tests/lib/libc/sys/Makefile       Sat Oct 15 06:17:02 2011 +0000
+++ b/tests/lib/libc/sys/Makefile       Sat Oct 15 06:26:33 2011 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.11 2011/10/15 06:17:02 jruoho Exp $
+# $NetBSD: Makefile,v 1.12 2011/10/15 06:26:34 jruoho Exp $
 
 MKMAN= no
 
@@ -25,6 +25,7 @@
 TESTS_C+=              t_kill
 TESTS_C+=              t_link
 TESTS_C+=              t_mincore
+TESTS_C+=              t_mkdir
 TESTS_C+=              t_mkfifo
 TESTS_C+=              t_mknod
 TESTS_C+=              t_mmap
diff -r 10abdfa360ab -r 831289e63438 tests/lib/libc/sys/t_mkdir.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/lib/libc/sys/t_mkdir.c      Sat Oct 15 06:26:33 2011 +0000
@@ -0,0 +1,84 @@
+/* $NetBSD: t_mkdir.c,v 1.1 2011/10/15 06:26:33 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2008 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jason R. Thorpe.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__COPYRIGHT("@(#) Copyright (c) 2008\
+ The NetBSD Foundation, inc. All rights reserved.");
+__RCSID("$NetBSD: t_mkdir.c,v 1.1 2011/10/15 06:26:33 jruoho Exp $");
+
+#include <sys/stat.h>
+
+#include <atf-c.h>
+#include <stdio.h>
+#include <unistd.h>
+
+ATF_TC(mkdir_trail);
+ATF_TC_HEAD(mkdir_trail, tc)
+{
+       atf_tc_set_md_var(tc, "descr", "Checks mkdir(2) for trailing slashes");
+}
+
+ATF_TC_BODY(mkdir_trail, tc)
+{
+       const char *tests[] = {
+               /*
+                * IEEE 1003.1 second ed. 2.2.2.78:
+                *
+                * If the pathname refers to a directory, it may also have
+                * one or more trailing slashes.  Multiple successive slashes
+                * are considered to be the same as one slash.
+                */
+               "dir1/",
+               "dir2//",
+
+               NULL,
+       };
+
+       const char **test;
+
+       for (test = &tests[0]; *test != NULL; ++test) {
+
+               (void)printf("Checking \"%s\"\n", *test);
+               (void)rmdir(*test);
+
+               ATF_REQUIRE(mkdir(*test, 0777) == 0);
+               ATF_REQUIRE(rename(*test, "foo") == 0);
+               ATF_REQUIRE(rename("foo/", *test) == 0);
+               ATF_REQUIRE(rmdir(*test) == 0);
+       }
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+       ATF_TP_ADD_TC(tp, mkdir_trail);
+
+       return atf_no_error();
+}



Home | Main Index | Thread Index | Old Index