Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/lib/libutil Make the 9 months ago test, when reverting...



details:   https://anonhg.NetBSD.org/src/rev/393116c7efd6
branches:  trunk
changeset: 345057:393116c7efd6
user:      kre <kre%NetBSD.org@localhost>
date:      Thu May 05 02:12:21 2016 +0000

description:
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).

diffstat:

 tests/lib/libutil/t_parsedate.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r b0c1223b5422 -r 393116c7efd6 tests/lib/libutil/t_parsedate.c
--- a/tests/lib/libutil/t_parsedate.c   Wed May 04 22:42:40 2016 +0000
+++ b/tests/lib/libutil/t_parsedate.c   Thu May 05 02:12:21 2016 +0000
@@ -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 @@
        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_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;



Home | Main Index | Thread Index | Old Index