summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authorngie <ngie@FreeBSD.org>2015-11-15 20:30:54 +0000
committerngie <ngie@FreeBSD.org>2015-11-15 20:30:54 +0000
commite6fd4959d625cea816f517634534fb8c64d80b9c (patch)
tree2724b2a92830c42f4c5b5dc074ee219d4622a685 /lib/libc
parent5ff7d08c684c7200fa796bba4b40fcc3a0cf8277 (diff)
downloadFreeBSD-src-e6fd4959d625cea816f517634534fb8c64d80b9c.zip
FreeBSD-src-e6fd4959d625cea816f517634534fb8c64d80b9c.tar.gz
MFC r290571:
Fix some TAP -> ATF conversion errors - Remove a leftover printf from when this was a TAP based testcase - Catch mmap failures properly Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/tests/gen/arc4random_test.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/libc/tests/gen/arc4random_test.c b/lib/libc/tests/gen/arc4random_test.c
index ec82c32..a28db30 100644
--- a/lib/libc/tests/gen/arc4random_test.c
+++ b/lib/libc/tests/gen/arc4random_test.c
@@ -30,10 +30,12 @@ __FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/wait.h>
+#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+
#include <atf-c.h>
/*
@@ -56,14 +58,9 @@ ATF_TC_BODY(test_arc4random, tc)
pid_t pid;
char c;
- printf("1..1\n");
-
page = mmap(NULL, sizeof(struct shared_page), PROT_READ | PROT_WRITE,
MAP_ANON | MAP_SHARED, -1, 0);
- if (page == MAP_FAILED) {
- printf("fail 1 - mmap\n");
- exit(1);
- }
+ ATF_REQUIRE_MSG(page != MAP_FAILED, "mmap failed; errno=%d", errno);
arc4random_buf(&c, 1);
OpenPOWER on IntegriCloud