NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: bin/50574 (lib/libutil/t_parsedate:relative test fails at times)
The following reply was made to PR bin/50574; it has been noted by GNATS.
From: David Holland <dholland-bugs%netbsd.org@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc:
Subject: Re: bin/50574 (lib/libutil/t_parsedate:relative test fails at times)
Date: Fri, 1 Jan 2016 19:59:08 +0000
On Fri, Jan 01, 2016 at 12:55:00PM +0000, Andreas Gustafsson wrote:
> There's a new failure in
>
> http://releng.netbsd.org/b5reports/i386/build/2015.12.31.20.11.32/test.html#lib_libutil_t_parsedate_relative
>
> with the error message
>
> *** Check failed: /tmp/bracket/build/2015.12.31.20.11.32-i386/src/tests/lib/libutil/t_parsedate.c:341: p != q: From "+6 months 2 days", obtained 1467502383 (Sat Jul 2 23:33:03 2016); expected 1467588783 (Sun Jul 3 23:33:03 2016)
That's an annoying one; it's not even clear what the right answer is.
If it's Dec. 31 and you add six months, that gets June 31, and since
there's no such day it's actually July 1. Then two more days is July
3. But, if you start on Dec. 31 and add two days, that's January 2,
and six months more is July 2. (And the inverse problem occurs on
April 30.)
Suggestions? The code in parsedate.y applies month and day offsets
separately. Maybe it should apply all the offsets and then renormalize
only once? That would at least provide consistent behavior.
--
David A. Holland
dholland%netbsd.org@localhost
Home |
Main Index |
Thread Index |
Old Index