Module Name: src
Committed By: jruoho
Date: Sat Oct 15 06:50:52 UTC 2011
Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/kernel: Makefile
src/tests/lib/libc/sys: Makefile
Added Files:
src/tests/lib/libc/sys: t_write.c
Removed Files:
src/tests/kernel: t_writev.c
Log Message:
Move the writev(2) test to the right place.
To generate a diff of this commit:
cvs rdiff -u -r1.406 -r1.407 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.18 -r1.19 src/tests/kernel/Makefile
cvs rdiff -u -r1.2 -r0 src/tests/kernel/t_writev.c
cvs rdiff -u -r1.13 -r1.14 src/tests/lib/libc/sys/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/sys/t_write.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.406 src/distrib/sets/lists/tests/mi:1.407
--- src/distrib/sets/lists/tests/mi:1.406 Sat Oct 15 06:42:17 2011
+++ src/distrib/sets/lists/tests/mi Sat Oct 15 06:50:52 2011
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.406 2011/10/15 06:42:17 jruoho Exp $
+# $NetBSD: mi,v 1.407 2011/10/15 06:50:52 jruoho Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@@ -334,7 +334,7 @@
./usr/libdata/debug/usr/tests/kernel/t_sigaction.debug tests-kernel-tests debug,atf
./usr/libdata/debug/usr/tests/kernel/t_time.debug tests-obsolete obsolete
./usr/libdata/debug/usr/tests/kernel/t_ucontext.debug tests-kernel-tests debug,atf
-./usr/libdata/debug/usr/tests/kernel/t_writev.debug tests-kernel-tests debug,atf
+./usr/libdata/debug/usr/tests/kernel/t_writev.debug tests-obsolete obsolete
./usr/libdata/debug/usr/tests/kernel/tty tests-kernel-tests
./usr/libdata/debug/usr/tests/kernel/tty/t_pr.debug tests-kernel-tests debug,atf
./usr/libdata/debug/usr/tests/lib tests-lib-debug
@@ -525,6 +525,7 @@
./usr/libdata/debug/usr/tests/lib/libc/sys/t_truncate.debug tests-lib-debug debug,atf
./usr/libdata/debug/usr/tests/lib/libc/sys/t_umask.debug tests-lib-debug debug,atf
./usr/libdata/debug/usr/tests/lib/libc/sys/t_unlink.debug tests-lib-debug debug,atf
+./usr/libdata/debug/usr/tests/lib/libc/sys/t_write.debug tests-lib-debug debug,atf
./usr/libdata/debug/usr/tests/lib/libc/termios tests-lib-debug
./usr/libdata/debug/usr/tests/lib/libc/termios/t_tcsetpgrp.debug tests-lib-debug debug,atf
./usr/libdata/debug/usr/tests/lib/libc/tls tests-lib-debug
@@ -1863,7 +1864,7 @@
./usr/tests/kernel/t_time tests-obsolete obsolete
./usr/tests/kernel/t_ucontext tests-kernel-tests atf
./usr/tests/kernel/t_umount tests-kernel-tests atf
-./usr/tests/kernel/t_writev tests-kernel-tests atf
+./usr/tests/kernel/t_writev tests-obsolete obsolete
./usr/tests/kernel/tty tests-kernel-tests
./usr/tests/kernel/tty/Atffile tests-kernel-tests atf
./usr/tests/kernel/tty/t_pr tests-kernel-tests atf
@@ -2141,6 +2142,7 @@
./usr/tests/lib/libc/sys/t_truncate tests-lib-tests atf
./usr/tests/lib/libc/sys/t_umask tests-lib-tests atf
./usr/tests/lib/libc/sys/t_unlink tests-lib-tests atf
+./usr/tests/lib/libc/sys/t_write tests-lib-tests atf
./usr/tests/lib/libc/termios tests-lib-tests
./usr/tests/lib/libc/termios/Atffile tests-lib-tests atf
./usr/tests/lib/libc/termios/t_tcsetpgrp tests-lib-tests atf
Index: src/tests/kernel/Makefile
diff -u src/tests/kernel/Makefile:1.18 src/tests/kernel/Makefile:1.19
--- src/tests/kernel/Makefile:1.18 Sat Oct 15 06:42:16 2011
+++ src/tests/kernel/Makefile Sat Oct 15 06:50:52 2011
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.18 2011/10/15 06:42:16 jruoho Exp $
+# $NetBSD: Makefile,v 1.19 2011/10/15 06:50:52 jruoho Exp $
NOMAN= # defined
@@ -13,7 +13,6 @@ TESTS_C+= t_lwpctl
TESTS_C+= t_pty
TESTS_C+= t_rnd
TESTS_C+= t_ucontext
-TESTS_C+= t_writev
TESTS_C+= t_extattrctl
TESTS_C+= t_sigaction
TESTS_C+= t_filedesc
Index: src/tests/lib/libc/sys/Makefile
diff -u src/tests/lib/libc/sys/Makefile:1.13 src/tests/lib/libc/sys/Makefile:1.14
--- src/tests/lib/libc/sys/Makefile:1.13 Sat Oct 15 06:42:16 2011
+++ src/tests/lib/libc/sys/Makefile Sat Oct 15 06:50:52 2011
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.13 2011/10/15 06:42:16 jruoho Exp $
+# $NetBSD: Makefile,v 1.14 2011/10/15 06:50:52 jruoho Exp $
MKMAN= no
@@ -46,6 +46,7 @@ TESTS_C+= t_timer_create
TESTS_C+= t_truncate
TESTS_C+= t_umask
TESTS_C+= t_unlink
+TESTS_C+= t_write
SRCS.t_mprotect= t_mprotect.c ${SRCS_EXEC_PROT}
Added files:
Index: src/tests/lib/libc/sys/t_write.c
diff -u /dev/null src/tests/lib/libc/sys/t_write.c:1.1
--- /dev/null Sat Oct 15 06:50:52 2011
+++ src/tests/lib/libc/sys/t_write.c Sat Oct 15 06:50:52 2011
@@ -0,0 +1,70 @@
+/* $NetBSD: t_write.c,v 1.1 2011/10/15 06:50:52 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2001, 2008 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * 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_write.c,v 1.1 2011/10/15 06:50:52 jruoho Exp $");
+
+#include <sys/uio.h>
+#include <sys/syslimits.h>
+
+#include <atf-c.h>
+#include <errno.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+
+ATF_TC(writev_iovmax);
+ATF_TC_HEAD(writev_iovmax, tc)
+{
+ atf_tc_set_md_var(tc, "timeout", "10");
+ atf_tc_set_md_var(tc, "descr",
+ "Checks that file descriptor is properly FILE_UNUSE()d "
+ "when iovcnt is greater than IOV_MAX");
+}
+
+ATF_TC_BODY(writev_iovmax, tc)
+{
+ ssize_t retval;
+
+ (void)printf("Calling writev(2, NULL, IOV_MAX + 1)...\n");
+
+ errno = 0;
+ retval = writev(2, NULL, IOV_MAX + 1);
+
+ ATF_REQUIRE_EQ_MSG(retval, -1, "got: %zd", retval);
+ ATF_REQUIRE_EQ_MSG(errno, EINVAL, "got: %s", strerror(errno));
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, writev_iovmax);
+
+ return atf_no_error();
+}