Source-Changes-HG archive

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

[src/trunk]: src Follow the real tree with the test directory structure.



details:   https://anonhg.NetBSD.org/src/rev/614fd2eb7d06
branches:  trunk
changeset: 764798:614fd2eb7d06
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Thu May 05 05:39:10 2011 +0000

description:
Follow the real tree with the test directory structure.

diffstat:

 distrib/sets/lists/tests/mi     |   11 +-
 etc/mtree/NetBSD.dist.tests     |    4 +-
 tests/include/Makefile          |    5 +-
 tests/include/machine/Makefile  |   10 ++
 tests/include/machine/t_bswap.c |  178 ++++++++++++++++++++++++++++++++++++++++
 tests/include/t_bswap.c         |  178 ----------------------------------------
 6 files changed, 201 insertions(+), 185 deletions(-)

diffs (truncated from 466 to 300 lines):

diff -r 5bbfc85ff9c1 -r 614fd2eb7d06 distrib/sets/lists/tests/mi
--- a/distrib/sets/lists/tests/mi       Thu May 05 05:28:52 2011 +0000
+++ b/distrib/sets/lists/tests/mi       Thu May 05 05:39:10 2011 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.328 2011/05/05 05:28:52 jruoho Exp $
+# $NetBSD: mi,v 1.329 2011/05/05 05:39:11 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -280,12 +280,14 @@
 ./usr/libdata/debug/usr/tests/fs/vfs/t_vfsops.debug                    tests-fs-debug          debug,atf
 ./usr/libdata/debug/usr/tests/fs/vfs/t_vnops.debug                     tests-fs-debug          debug,atf
 ./usr/libdata/debug/usr/tests/include                                  tests-include-tests
+./usr/libdata/debug/usr/tests/include/machine                          tests-include-tests
+./usr/libdata/debug/usr/tests/include/machine/t_bswap.debug            tests-include-tests     debug,atf
 ./usr/libdata/debug/usr/tests/include/sys                              tests-include-tests
 ./usr/libdata/debug/usr/tests/include/sys/t_bitops.debug               tests-include-tests     debug,atf
 ./usr/libdata/debug/usr/tests/include/sys/t_bootblock.debug            tests-include-tests     debug,atf
 ./usr/libdata/debug/usr/tests/include/sys/t_types.debug                        tests-include-tests     debug,atf
 ./usr/libdata/debug/usr/tests/include/t_bitstring.debug                        tests-include-tests     debug,atf
-./usr/libdata/debug/usr/tests/include/t_bswap.debug                    tests-include-tests     debug,atf
+./usr/libdata/debug/usr/tests/include/t_bswap.debug                    tests-obsolete          obsolete
 ./usr/libdata/debug/usr/tests/include/t_errno.debug                    tests-include-tests     debug,atf
 ./usr/libdata/debug/usr/tests/include/t_glob.debug                     tests-include-tests     debug,atf
 ./usr/libdata/debug/usr/tests/include/t_inttypes.debug                 tests-include-tests     debug,atf
@@ -1381,13 +1383,16 @@
 ./usr/tests/include/d_bitstring_64.out         tests-include-tests     atf
 ./usr/tests/include/d_bitstring_67.out         tests-include-tests     atf
 ./usr/tests/include/d_bitstring_8.out          tests-include-tests     atf
+./usr/tests/include/machine                    tests-include-tests
+./usr/tests/include/machine/Atffile            tests-include-tests     atf
+./usr/tests/include/machine/t_bswap            tests-include-tests     atf
 ./usr/tests/include/sys                                tests-include-tests
 ./usr/tests/include/sys/Atffile                        tests-include-tests     atf
 ./usr/tests/include/sys/t_bitops               tests-include-tests     atf
 ./usr/tests/include/sys/t_bootblock            tests-include-tests     atf
 ./usr/tests/include/sys/t_types                        tests-include-tests     atf
 ./usr/tests/include/t_bitstring                        tests-include-tests     atf
-./usr/tests/include/t_bswap                    tests-include-tests     atf
+./usr/tests/include/t_bswap                    tests-obsolete          obsolete
 ./usr/tests/include/t_errno                    tests-include-tests     atf
 ./usr/tests/include/t_glob                     tests-include-tests     atf
 ./usr/tests/include/t_inttypes                 tests-include-tests     atf
diff -r 5bbfc85ff9c1 -r 614fd2eb7d06 etc/mtree/NetBSD.dist.tests
--- a/etc/mtree/NetBSD.dist.tests       Thu May 05 05:28:52 2011 +0000
+++ b/etc/mtree/NetBSD.dist.tests       Thu May 05 05:39:10 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: NetBSD.dist.tests,v 1.46 2011/05/03 15:13:50 jruoho Exp $
+#      $NetBSD: NetBSD.dist.tests,v 1.47 2011/05/05 05:39:11 jruoho Exp $
 
 ./usr/libdata/debug/usr/tests
 ./usr/libdata/debug/usr/tests/atf
@@ -36,6 +36,7 @@
 ./usr/libdata/debug/usr/tests/fs/union
 ./usr/libdata/debug/usr/tests/fs/vfs
 ./usr/libdata/debug/usr/tests/include
+./usr/libdata/debug/usr/tests/include/machine
 ./usr/libdata/debug/usr/tests/include/sys
 ./usr/libdata/debug/usr/tests/ipf
 ./usr/libdata/debug/usr/tests/kernel
@@ -150,6 +151,7 @@
 ./usr/tests/fs/zfs
 ./usr/tests/games
 ./usr/tests/include
+./usr/tests/include/machine
 ./usr/tests/include/sys
 ./usr/tests/ipf
 ./usr/tests/ipf/expected
diff -r 5bbfc85ff9c1 -r 614fd2eb7d06 tests/include/Makefile
--- a/tests/include/Makefile    Thu May 05 05:28:52 2011 +0000
+++ b/tests/include/Makefile    Thu May 05 05:39:10 2011 +0000
@@ -1,14 +1,13 @@
-# $NetBSD: Makefile,v 1.8 2011/05/05 05:24:44 jruoho Exp $
+# $NetBSD: Makefile,v 1.9 2011/05/05 05:39:10 jruoho Exp $
 
 NOMAN=         # defined
 
 .include <bsd.own.mk>
 
 TESTSDIR=      ${TESTSBASE}/include
-TESTS_SUBDIRS= sys
+TESTS_SUBDIRS= machine sys
 
 TESTS_C=       t_bitstring
-TESTS_C+=      t_bswap
 TESTS_C+=      t_errno
 TESTS_C+=      t_glob
 TESTS_C+=      t_inttypes
diff -r 5bbfc85ff9c1 -r 614fd2eb7d06 tests/include/machine/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/include/machine/Makefile    Thu May 05 05:39:10 2011 +0000
@@ -0,0 +1,10 @@
+# $NetBSD: Makefile,v 1.1 2011/05/05 05:39:11 jruoho Exp $
+
+NOMAN=         # defined
+
+.include <bsd.own.mk>
+
+TESTSDIR=              ${TESTSBASE}/include/machine
+TESTS_C=               t_bswap
+
+.include <bsd.test.mk>
diff -r 5bbfc85ff9c1 -r 614fd2eb7d06 tests/include/machine/t_bswap.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/include/machine/t_bswap.c   Thu May 05 05:39:10 2011 +0000
@@ -0,0 +1,178 @@
+/* $NetBSD: t_bswap.c,v 1.1 2011/05/05 05:39:11 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * 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>
+__RCSID("$NetBSD: t_bswap.c,v 1.1 2011/05/05 05:39:11 jruoho Exp $");
+
+#include <sys/types.h>
+#include <machine/bswap.h>
+
+#include <atf-c.h>
+
+static uint16_t x16;
+static uint32_t x32;
+static uint64_t x64;
+
+static uint16_t        unconst16(uint16_t);
+static uint32_t        unconst32(uint32_t);
+static uint64_t        unconst64(uint64_t);
+
+/*
+ * Given the use of __builtin_constant_p(3),
+ * these functions try to avoid gcc(1) from
+ * treating the arguments as constants.
+ */
+static uint16_t
+unconst16(uint16_t val)
+{
+       return val + x16;
+}
+
+static uint32_t
+unconst32(uint32_t val)
+{
+       return val + x32;
+}
+
+static uint64_t
+unconst64(uint64_t val)
+{
+       return val + x64;
+}
+
+ATF_TC(bswap16_basic);
+ATF_TC_HEAD(bswap16_basic, tc)
+{
+       atf_tc_set_md_var(tc, "descr", "A naive test of bswap16(3), #1");
+}
+
+ATF_TC_BODY(bswap16_basic, tc)
+{
+       ATF_REQUIRE_EQ(bswap16(0x0000), 0x0000);
+       ATF_REQUIRE_EQ(bswap16(0xff00), 0x00ff);
+       ATF_REQUIRE_EQ(bswap16(0xffff), 0xffff);
+       ATF_REQUIRE_EQ(bswap16(0x1234), 0x3412);
+}
+
+ATF_TC(bswap16_unconst);
+ATF_TC_HEAD(bswap16_unconst, tc)
+{
+       atf_tc_set_md_var(tc, "descr", "A naive test of bswap16(3), #2");
+}
+
+ATF_TC_BODY(bswap16_unconst, tc)
+{
+       x16 = 0;
+
+       ATF_REQUIRE_EQ(bswap16(unconst16(0x0000)), 0x0000);
+       ATF_REQUIRE_EQ(bswap16(unconst16(0xff00)), 0x00ff);
+       ATF_REQUIRE_EQ(bswap16(unconst16(0xffff)), 0xffff);
+       ATF_REQUIRE_EQ(bswap16(unconst16(0x1234)), 0x3412);
+}
+
+ATF_TC(bswap32_basic);
+ATF_TC_HEAD(bswap32_basic, tc)
+{
+       atf_tc_set_md_var(tc, "descr", "A naive test of bswap32(3), #1");
+}
+
+ATF_TC_BODY(bswap32_basic, tc)
+{
+       ATF_REQUIRE_EQ(bswap32(0x00000000), 0x00000000);
+       ATF_REQUIRE_EQ(bswap32(0xffff0000), 0x0000ffff);
+       ATF_REQUIRE_EQ(bswap32(0xffffffff), 0xffffffff);
+       ATF_REQUIRE_EQ(bswap32(0x12345678), 0x78563412);
+}
+
+ATF_TC(bswap32_unconst);
+ATF_TC_HEAD(bswap32_unconst, tc)
+{
+       atf_tc_set_md_var(tc, "descr", "A naive test of bswap32(3), #2");
+}
+
+ATF_TC_BODY(bswap32_unconst, tc)
+{
+       x32 = 0;
+
+       ATF_REQUIRE_EQ(bswap32(unconst32(0x00000000)), 0x00000000);
+       ATF_REQUIRE_EQ(bswap32(unconst32(0xffff0000)), 0x0000ffff);
+       ATF_REQUIRE_EQ(bswap32(unconst32(0xffffffff)), 0xffffffff);
+       ATF_REQUIRE_EQ(bswap32(unconst32(0x12345678)), 0x78563412);
+}
+
+ATF_TC(bswap64_basic);
+ATF_TC_HEAD(bswap64_basic, tc)
+{
+       atf_tc_set_md_var(tc, "descr", "A naive test of bswap64(3), #1");
+}
+
+ATF_TC_BODY(bswap64_basic, tc)
+{
+       ATF_REQUIRE_EQ(bswap64(0x0000000000000000), 0x0000000000000000);
+       ATF_REQUIRE_EQ(bswap64(0xffffffff00000000), 0x00000000ffffffff);
+       ATF_REQUIRE_EQ(bswap64(0xffffffffffffffff), 0xffffffffffffffff);
+       ATF_REQUIRE_EQ(bswap64(0x123456789abcdeff), 0xffdebc9a78563412);
+}
+
+ATF_TC(bswap64_unconst);
+ATF_TC_HEAD(bswap64_unconst, tc)
+{
+       atf_tc_set_md_var(tc, "descr", "A naive test of bswap64(3), #2");
+}
+
+ATF_TC_BODY(bswap64_unconst, tc)
+{
+       x64 = 0;
+
+       ATF_REQUIRE_EQ(bswap64(unconst64(0x0000000000000000)),
+           0x0000000000000000);
+
+       ATF_REQUIRE_EQ(bswap64(unconst64(0xffffffff00000000)),
+           0x00000000ffffffff);
+
+       ATF_REQUIRE_EQ(bswap64(unconst64(0xffffffffffffffff)),
+           0xffffffffffffffff);
+
+       ATF_REQUIRE_EQ(bswap64(unconst64(0x123456789abcdeff)),
+           0xffdebc9a78563412);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+       ATF_TP_ADD_TC(tp, bswap16_basic);
+       ATF_TP_ADD_TC(tp, bswap16_unconst);
+       ATF_TP_ADD_TC(tp, bswap32_basic);
+       ATF_TP_ADD_TC(tp, bswap32_unconst);
+       ATF_TP_ADD_TC(tp, bswap64_basic);
+       ATF_TP_ADD_TC(tp, bswap64_unconst);
+
+       return atf_no_error();
+}
diff -r 5bbfc85ff9c1 -r 614fd2eb7d06 tests/include/t_bswap.c
--- a/tests/include/t_bswap.c   Thu May 05 05:28:52 2011 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,178 +0,0 @@
-/* $NetBSD: t_bswap.c,v 1.1 2011/05/03 04:50:31 jruoho Exp $ */
-
-/*-
- * Copyright (c) 2011 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Jukka Ruohonen.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:



Home | Main Index | Thread Index | Old Index