Module Name: src Committed By: jruoho Date: Sat Oct 15 06:54:53 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_ucontext.c Removed Files: src/tests/kernel: t_ucontext.c Log Message: Move the ucontext(2) test to the right place. To generate a diff of this commit: cvs rdiff -u -r1.407 -r1.408 src/distrib/sets/lists/tests/mi cvs rdiff -u -r1.19 -r1.20 src/tests/kernel/Makefile cvs rdiff -u -r1.1 -r0 src/tests/kernel/t_ucontext.c cvs rdiff -u -r1.14 -r1.15 src/tests/lib/libc/sys/Makefile cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/sys/t_ucontext.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.407 src/distrib/sets/lists/tests/mi:1.408 --- src/distrib/sets/lists/tests/mi:1.407 Sat Oct 15 06:50:52 2011 +++ src/distrib/sets/lists/tests/mi Sat Oct 15 06:54:53 2011 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.407 2011/10/15 06:50:52 jruoho Exp $ +# $NetBSD: mi,v 1.408 2011/10/15 06:54:53 jruoho Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # @@ -333,7 +333,7 @@ ./usr/libdata/debug/usr/tests/kernel/t_rnd.debug tests-kernel-tests debug,atf ./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_ucontext.debug tests-obsolete obsolete ./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 @@ -523,6 +523,7 @@ ./usr/libdata/debug/usr/tests/lib/libc/sys/t_stat.debug tests-lib-debug debug,atf ./usr/libdata/debug/usr/tests/lib/libc/sys/t_timer_create.debug tests-lib-debug debug,atf ./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_ucontext.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 @@ -1862,7 +1863,7 @@ ./usr/tests/kernel/t_rnd tests-kernel-tests atf ./usr/tests/kernel/t_sigaction tests-kernel-tests atf ./usr/tests/kernel/t_time tests-obsolete obsolete -./usr/tests/kernel/t_ucontext tests-kernel-tests atf +./usr/tests/kernel/t_ucontext tests-obsolete obsolete ./usr/tests/kernel/t_umount tests-kernel-tests atf ./usr/tests/kernel/t_writev tests-obsolete obsolete ./usr/tests/kernel/tty tests-kernel-tests @@ -2140,6 +2141,7 @@ ./usr/tests/lib/libc/sys/t_stat tests-lib-tests atf ./usr/tests/lib/libc/sys/t_timer_create tests-lib-tests atf ./usr/tests/lib/libc/sys/t_truncate tests-lib-tests atf +./usr/tests/lib/libc/sys/t_ucontext 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 Index: src/tests/kernel/Makefile diff -u src/tests/kernel/Makefile:1.19 src/tests/kernel/Makefile:1.20 --- src/tests/kernel/Makefile:1.19 Sat Oct 15 06:50:52 2011 +++ src/tests/kernel/Makefile Sat Oct 15 06:54:53 2011 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.19 2011/10/15 06:50:52 jruoho Exp $ +# $NetBSD: Makefile,v 1.20 2011/10/15 06:54:53 jruoho Exp $ NOMAN= # defined @@ -12,7 +12,6 @@ TESTS_C= t_lock TESTS_C+= t_lwpctl TESTS_C+= t_pty TESTS_C+= t_rnd -TESTS_C+= t_ucontext 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.14 src/tests/lib/libc/sys/Makefile:1.15 --- src/tests/lib/libc/sys/Makefile:1.14 Sat Oct 15 06:50:52 2011 +++ src/tests/lib/libc/sys/Makefile Sat Oct 15 06:54:52 2011 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.14 2011/10/15 06:50:52 jruoho Exp $ +# $NetBSD: Makefile,v 1.15 2011/10/15 06:54:52 jruoho Exp $ MKMAN= no @@ -44,6 +44,7 @@ TESTS_C+= t_sigqueue TESTS_C+= t_stat TESTS_C+= t_timer_create TESTS_C+= t_truncate +TESTS_C+= t_ucontext TESTS_C+= t_umask TESTS_C+= t_unlink TESTS_C+= t_write Added files: Index: src/tests/lib/libc/sys/t_ucontext.c diff -u /dev/null src/tests/lib/libc/sys/t_ucontext.c:1.1 --- /dev/null Sat Oct 15 06:54:53 2011 +++ src/tests/lib/libc/sys/t_ucontext.c Sat Oct 15 06:54:52 2011 @@ -0,0 +1,76 @@ +/* $NetBSD: t_ucontext.c,v 1.1 2011/10/15 06:54:52 jruoho Exp $ */ + +/* + * Copyright (c) 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_ucontext.c,v 1.1 2011/10/15 06:54:52 jruoho Exp $"); + +#include <atf-c.h> +#include <stdio.h> +#include <ucontext.h> + +ATF_TC(ucontext_basic); +ATF_TC_HEAD(ucontext_basic, tc) +{ + atf_tc_set_md_var(tc, "descr", "Checks {get,set}context(2)"); +} + +ATF_TC_BODY(ucontext_basic, tc) +{ + ucontext_t u, v, w; + volatile int x, y; + + x = 0; + y = 0; + + printf("Start\n"); + + getcontext(&u); + y++; + + printf("x == %d\n", x); + + getcontext(&v); + + if ( x < 20 ) { + x++; + getcontext(&w); + setcontext(&u); + } + + printf("End, y = %d\n", y); + ATF_REQUIRE_EQ(y, 21); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, ucontext_basic); + + return atf_no_error(); +}