summaryrefslogtreecommitdiffstats
path: root/contrib/netbsd-tests/lib/libc/gen/t_time.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_time.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_time.c')
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/t_time.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_time.c b/contrib/netbsd-tests/lib/libc/gen/t_time.c
index 790f3ca..2905403 100644
--- a/contrib/netbsd-tests/lib/libc/gen/t_time.c
+++ b/contrib/netbsd-tests/lib/libc/gen/t_time.c
@@ -1,4 +1,4 @@
-/* $NetBSD: t_time.c,v 1.2 2011/11/11 05:03:38 jruoho Exp $ */
+/* $NetBSD: t_time.c,v 1.3 2014/10/31 12:22:38 justin Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: t_time.c,v 1.2 2011/11/11 05:03:38 jruoho Exp $");
+__RCSID("$NetBSD: t_time.c,v 1.3 2014/10/31 12:22:38 justin Exp $");
#ifdef __FreeBSD__
#include <sys/time.h>
@@ -94,15 +94,16 @@ ATF_TC_HEAD(time_timeofday, tc)
ATF_TC_BODY(time_timeofday, tc)
{
struct timeval tv = { 0, 0 };
- time_t t;
+ time_t t1, t2;
- t = time(NULL);
+ t1 = time(NULL);
ATF_REQUIRE(gettimeofday(&tv, NULL) == 0);
+ t2 = time(NULL);
(void)fprintf(stderr, "%"PRId64" vs. %"PRId64"\n",
- (int64_t)t, (int64_t)tv.tv_sec);
+ (int64_t)t1, (int64_t)tv.tv_sec);
- if (t != tv.tv_sec)
+ if (t1 > tv.tv_sec || t2 < tv.tv_sec)
atf_tc_fail("time(3) and gettimeofday(2) differ");
}
OpenPOWER on IntegriCloud