Source-Changes-HG archive

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

[src/trunk]: src/tests/lib/libutil Fix REL_CHECK error output; it had "expect...



details:   https://anonhg.NetBSD.org/src/rev/56dd92df1fa1
branches:  trunk
changeset: 342605:56dd92df1fa1
user:      dholland <dholland%NetBSD.org@localhost>
date:      Thu Dec 31 10:56:13 2015 +0000

description:
Fix REL_CHECK error output; it had "expected" and "obtained" swapped.
While here, improve the general legibility of the printout. Not
actually relevant to PR 50574, but anyone looking at that should be
aware of this change.

diffstat:

 tests/lib/libutil/t_parsedate.c |  13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diffs (34 lines):

diff -r 7a6d8e2ce693 -r 56dd92df1fa1 tests/lib/libutil/t_parsedate.c
--- a/tests/lib/libutil/t_parsedate.c   Thu Dec 31 10:52:06 2015 +0000
+++ b/tests/lib/libutil/t_parsedate.c   Thu Dec 31 10:56:13 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_parsedate.c,v 1.18 2015/12/31 10:18:00 dholland Exp $ */
+/* $NetBSD: t_parsedate.c,v 1.19 2015/12/31 10:56:13 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.18 2015/12/31 10:18:00 dholland Exp $");
+__RCSID("$NetBSD: t_parsedate.c,v 1.19 2015/12/31 10:56:13 dholland Exp $");
 
 #include <atf-c.h>
 #include <errno.h>
@@ -245,10 +245,11 @@
 #define REL_CHECK(s, now, tm) do {                                     \
        time_t p, q;                                                    \
        char pb[30], qb[30];                                            \
-       ATF_CHECK_EQ_MSG((p = parsedate(s, &now, NULL)),                \
-           (q = mktime(&tm)),                                          \
-           "From %s Expected %jd: %24.24s Obtained %jd: %24.24s", s,   \
-           (uintmax_t)p, ctime_r(&p, pb), (uintmax_t)q,                \
+       p = parsedate(s, &now, NULL);                                   \
+       q = mktime(&tm);                                                \
+       ATF_CHECK_EQ_MSG(p, q,                                          \
+           "From \"%s\", obtained %jd (%24.24s); expected %jd (%24.24s)", \
+           s, (uintmax_t)p, ctime_r(&p, pb), (uintmax_t)q,             \
            ctime_r(&q, qb));                                           \
     } while (/*CONSTCOND*/0)
 



Home | Main Index | Thread Index | Old Index