Module Name: src
Committed By: dholland
Date: Thu Dec 31 10:10:15 UTC 2015
Modified Files:
src/tests/lib/libutil: t_parsedate.c
Log Message:
Fix the "Tuesday midnight" test to match what parsedate.y does; in
particular it doesn't add a week if evaluating that on Wednesday.
Whether that's right is an open question, but there's not exactly a
spec for parsedate.y and there's no point having the test fail one
day in seven.
PR 50574.
To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/tests/lib/libutil/t_parsedate.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/tests/lib/libutil/t_parsedate.c
diff -u src/tests/lib/libutil/t_parsedate.c:1.16 src/tests/lib/libutil/t_parsedate.c:1.17
--- src/tests/lib/libutil/t_parsedate.c:1.16 Tue Dec 8 12:41:28 2015
+++ src/tests/lib/libutil/t_parsedate.c Thu Dec 31 10:10:15 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: t_parsedate.c,v 1.16 2015/12/08 12:41:28 christos Exp $ */
+/* $NetBSD: t_parsedate.c,v 1.17 2015/12/31 10:10:15 dholland 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.16 2015/12/08 12:41:28 christos Exp $");
+__RCSID("$NetBSD: t_parsedate.c,v 1.17 2015/12/31 10:10:15 dholland Exp $");
#include <atf-c.h>
#include <errno.h>
@@ -380,7 +380,7 @@ ATF_TC_BODY(relative, tc)
REL_CHECK("midnight Tuesday", now, tm);
ATF_CHECK(localtime_r(&now, &tm) != NULL);
- if (tm.tm_wday > 2)
+ if (tm.tm_wday > 2 + 1)
tm.tm_mday += 7;
tm.tm_mday += 2 - tm.tm_wday;
tm.tm_mday++; /* xxx midnight --> the next day */