mktime regression test from Andy Shevchenko

This commit is contained in:
christos 2008-08-27 08:50:04 +00:00
parent 40d362f8e0
commit 70e554789a
3 changed files with 34 additions and 2 deletions

View File

@ -1,5 +1,5 @@
# $NetBSD: Makefile,v 1.1 1998/01/21 05:46:30 mycroft Exp $
# $NetBSD: Makefile,v 1.2 2008/08/27 08:50:04 christos Exp $
SUBDIR+=strptime
SUBDIR+=mktime strptime
.include <bsd.subdir.mk>

View File

@ -0,0 +1,10 @@
# $NetBSD: Makefile,v 1.1 2008/08/27 08:50:04 christos Exp $
NOMAN= # defined
PROG= mktime
regress:
./${PROG}
.include <bsd.prog.mk>

View File

@ -0,0 +1,22 @@
#include <err.h>
#include <errno.h>
#include <string.h>
#include <time.h>
int
main(void)
{
time_t rc;
struct tm tms;
(void)memset(&tms, 0, sizeof(tms));
tms.tm_year = ~0;
errno = 0;
rc = mktime(&tms);
if (errno != 0)
errx(1, "mktime(): errno was %d", errno);
return 0;
}