Make the 9 months ago test, when reverting from late November to the
end of Feburary just a little less bogus (stupid cut & paste error).
This commit is contained in:
parent
d04a36ae01
commit
25d58d24b2
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: t_parsedate.c,v 1.23 2016/05/04 18:36:46 gson Exp $ */
|
||||
/* $NetBSD: t_parsedate.c,v 1.24 2016/05/05 02:12:21 kre Exp $ */
|
||||
/*-
|
||||
* Copyright (c) 2010, 2015 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
@ -29,7 +29,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__RCSID("$NetBSD: t_parsedate.c,v 1.23 2016/05/04 18:36:46 gson Exp $");
|
||||
__RCSID("$NetBSD: t_parsedate.c,v 1.24 2016/05/05 02:12:21 kre Exp $");
|
||||
|
||||
#include <atf-c.h>
|
||||
#include <errno.h>
|
||||
@ -249,7 +249,7 @@ ATF_TC_BODY(relative, tc)
|
||||
q = mktime(&tm); \
|
||||
ATF_CHECK_EQ_MSG(p, q, \
|
||||
"From %jd (%24.24s) using \"%s\", obtained %jd (%24.24s); expected %jd (%24.24s)", \
|
||||
now, ctime_r(&now, nb), \
|
||||
(uintmax_t)now, ctime_r(&now, nb), \
|
||||
s, (uintmax_t)p, ctime_r(&p, pb), (uintmax_t)q, \
|
||||
ctime_r(&q, qb)); \
|
||||
} while (/*CONSTCOND*/0)
|
||||
@ -375,7 +375,7 @@ ATF_TC_BODY(relative, tc)
|
||||
ATF_CHECK(localtime_r(&now, &tm) != NULL);
|
||||
tm.tm_mon -= 9;
|
||||
if (tm.tm_mon == 1 && tm.tm_mday > 28 + isleap(tm.tm_year))
|
||||
tm.tm_mday = tm.tm_mday > 28 + isleap(tm.tm_year);
|
||||
tm.tm_mday = 28 + isleap(tm.tm_year);
|
||||
else if ((tm.tm_mon == -9 || tm.tm_mon == -7 ||
|
||||
tm.tm_mon == -2) && tm.tm_mday == 31)
|
||||
tm.tm_mday = 30;
|
||||
|
Loading…
Reference in New Issue
Block a user