summaryrefslogtreecommitdiffstats
path: root/contrib/netbsd-tests/lib/libc/gen/t_randomid.c
diff options
context:
space:
mode:
authorngie <ngie@FreeBSD.org>2016-12-03 02:47:16 +0000
committerngie <ngie@FreeBSD.org>2016-12-03 02:47:16 +0000
commit29db3b90328498474388e9cfb2c8ef6d816c05c2 (patch)
tree91ac81530a80d5ea64a24212d143cb2012f49a0a /contrib/netbsd-tests/lib/libc/gen/t_randomid.c
parent8408238ce58163c0d88dea333c155b6806aae830 (diff)
downloadFreeBSD-src-29db3b90328498474388e9cfb2c8ef6d816c05c2.zip
FreeBSD-src-29db3b90328498474388e9cfb2c8ef6d816c05c2.tar.gz
MFC r305358:
Update contrib/netbsd-tests with new content from NetBSD This updates the snapshot from 09/30/2014 to 08/11/2016 This brings in a number of new testcases from upstream, most notably: - bin/cat - lib/libc - lib/msun - lib/libthr - usr.bin/sort lib/libc/tests/stdio/open_memstream_test.c was moved to lib/libc/tests/stdio/open_memstream2_test.c to accomodate the new open_memstream test from NetBSD. Tested on: amd64 (VMware fusion VM; various bare metal platforms); i386 (VMware fusion VM); make tinderbox
Diffstat (limited to 'contrib/netbsd-tests/lib/libc/gen/t_randomid.c')
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/t_randomid.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_randomid.c b/contrib/netbsd-tests/lib/libc/gen/t_randomid.c
index 8377806..9ab2cca 100644
--- a/contrib/netbsd-tests/lib/libc/gen/t_randomid.c
+++ b/contrib/netbsd-tests/lib/libc/gen/t_randomid.c
@@ -1,4 +1,4 @@
-/* $NetBSD: t_randomid.c,v 1.3 2011/07/07 09:49:59 jruoho Exp $ */
+/* $NetBSD: t_randomid.c,v 1.5 2015/03/07 09:59:15 isaki Exp $ */
/*-
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
#define PERIOD 30000
-uint64_t last[65536];
+uint32_t last[65536];
ATF_TC(randomid_basic);
ATF_TC_HEAD(randomid_basic, tc)
@@ -50,30 +50,30 @@ ATF_TC_HEAD(randomid_basic, tc)
ATF_TC_BODY(randomid_basic, tc)
{
static randomid_t ctx = NULL;
- uint64_t lowest, n, diff;
+ uint32_t lowest, n, diff;
uint16_t id;
memset(last, 0, sizeof(last));
ctx = randomid_new(16, (long)3600);
- lowest = UINT64_MAX;
+ lowest = UINT32_MAX;
- for (n = 0; n < 1000000; n++) {
+ for (n = 0; n < 100000; n++) {
id = randomid(ctx);
if (last[id] > 0) {
diff = n - last[id];
if (diff <= lowest) {
- if (lowest != UINT64_MAX)
- printf("id %5d: last call at %9"PRIu64
- ", current call %9"PRIu64
- " (diff %5"PRIu64"), "
- "lowest %"PRIu64"\n",
+ if (lowest != UINT32_MAX)
+ printf("id %5d: last call at %9"PRIu32
+ ", current call %9"PRIu32
+ " (diff %5"PRIu32"), "
+ "lowest %"PRIu32"\n",
id, last[id], n, diff, lowest);
ATF_REQUIRE_MSG(diff >= PERIOD,
- "diff (%"PRIu64") less than minimum "
+ "diff (%"PRIu32") less than minimum "
"period (%d)", diff, PERIOD);
lowest = diff;
OpenPOWER on IntegriCloud