diff options
author | ngie <ngie@FreeBSD.org> | 2014-10-13 02:44:35 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2014-10-13 02:44:35 +0000 |
commit | 56e7f9c5eb57f41bff12067ab49a3a56a274f6cd (patch) | |
tree | 72d1e53f599c9f79302faf5e0142f7cf177c5019 /contrib/netbsd-tests/lib/libc | |
parent | 18628d06309cff733d706f08f4013615cc6bcc17 (diff) | |
download | FreeBSD-src-56e7f9c5eb57f41bff12067ab49a3a56a274f6cd.zip FreeBSD-src-56e7f9c5eb57f41bff12067ab49a3a56a274f6cd.tar.gz |
Only test the return value in mktime_negyear
Testing for the errno is an optional requirement according to POSIX, and
FreeBSD doesn't document that errno would be set on failure with mktime
Submitted by: pho
Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'contrib/netbsd-tests/lib/libc')
-rw-r--r-- | contrib/netbsd-tests/lib/libc/time/t_mktime.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/contrib/netbsd-tests/lib/libc/time/t_mktime.c b/contrib/netbsd-tests/lib/libc/time/t_mktime.c index 8092361..caef906 100644 --- a/contrib/netbsd-tests/lib/libc/time/t_mktime.c +++ b/contrib/netbsd-tests/lib/libc/time/t_mktime.c @@ -72,7 +72,12 @@ ATF_TC_BODY(mktime_negyear, tc) errno = 0; t = mktime(&tms); +#if defined(__FreeBSD__) + /* Open Group says "and may set errno to indicate the error" */ + ATF_REQUIRE(t == (time_t)-1); +#else ATF_REQUIRE_ERRNO(0, t != (time_t)-1); +#endif } ATF_TC(timegm_epoch); |