Module Name:    src
Committed By:   njoly
Date:           Fri May  6 22:24:41 UTC 2011

Modified Files:
        src/tests/syscall: t_mprotect.c

Log Message:
Do not return for early failures; otherwise the testcase will be
reported as passed, even if not really run.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/syscall/t_mprotect.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/syscall/t_mprotect.c
diff -u src/tests/syscall/t_mprotect.c:1.5 src/tests/syscall/t_mprotect.c:1.6
--- src/tests/syscall/t_mprotect.c:1.5	Fri May  6 21:51:19 2011
+++ src/tests/syscall/t_mprotect.c	Fri May  6 22:24:41 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: t_mprotect.c,v 1.5 2011/05/06 21:51:19 njoly Exp $ */
+/* $NetBSD: t_mprotect.c,v 1.6 2011/05/06 22:24:41 njoly Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_mprotect.c,v 1.5 2011/05/06 21:51:19 njoly Exp $");
+__RCSID("$NetBSD: t_mprotect.c,v 1.6 2011/05/06 22:24:41 njoly Exp $");
 
 #include <sys/param.h>
 #include <sys/mman.h>
@@ -116,9 +116,7 @@
 	int fd;
 
 	fd = open(path, O_RDONLY | O_CREAT);
-
-	if (fd < 0)
-		return;
+	ATF_REQUIRE(fd >= 0);
 
 	/*
 	 * The call should fail with EACCES if we try to mark
@@ -241,9 +239,7 @@
 	 * to the page. This should generate a SIGSEGV.
 	 */
 	map = mmap(NULL, page, PROT_WRITE|PROT_READ, MAP_ANON, -1, 0);
-
-	if (map == MAP_FAILED)
-		return;
+	ATF_REQUIRE(map != MAP_FAILED);
 
 	ATF_REQUIRE(strlcpy(map, "XXX", 3) == 3);
 	ATF_REQUIRE(mprotect(map, page, PROT_READ) == 0);

Reply via email to