On Mon Apr 07 18:02:48 2008, SREZIC wrote:
Show quoted text> On Sat Apr 05 16:49:09 2008, ANDK wrote:
> > Several smoke machines have by now reported FAILs on your tests.
> >
> >
http://bbbike2.radzeit.de/~slaven/cpantestersmatrix.cgi?dist=Time-
> > Simple;maxver=
> >
> > /Time-Simple......Bailout called. Further testing stopped:
> >
> > # Failed test 'hr from array'
> > # at t/Time-Simple.t line 20.
> > # got: '22'
> > # expected: '23'
> >
> > # Failed test 'stringified'
> > # at t/Time-Simple.t line 27.
> > # '22:59:59'
> > # doesn't match '(?-xism:23:59:59)'
> >
> > # Failed test 'inc after inc'
> > # at t/Time-Simple.t line 32.
> > # '23:00:00'
> > # doesn't match '(?-xism:00:00:00)'
> > Use of uninitialized value $reason in concatenation (.) or string at
> > /home/src/perl/repoperls/installed-perls/perl/pk3qAL1/perl-
> > 5.10.0@33646/lib/5.11.0/Test/Builder.pm
> > line 772.
> > make[3]: *** [test_dynamic] Error 1
> > make[3]: Leaving directory `/home/sand/.cpan/build/Time-Simple-
0.053-
Show quoted text> > uVlUfk'
> >
>
> This is probably caused by this change in perl5.10 in conjunction with
> DST turned on/off:
>
> [ 30590] By: rgs on 2007/03/15
09:35:14
Show quoted text> Log: Make the isdst argument to asctime and mktime default
to -1
Show quoted text> instead of 0, as suggested by Mike Schilli.
> Branch: perl
> ! ext/POSIX/POSIX.pm ext/POSIX/POSIX.pod ext/POSIX/POSIX.xs
AFAIK the argument is always supplied, but I will get a Perl 5.10 and
test. Ticket stalled until then.
Show quoted text> However, I took a look through the source code and found serious
> problems. In many places localtime is used without a time argument
(e.g.
Show quoted text> (localtime)[4] etc.),
I could only see that in one place, _mktime_hms, which I have now
updated.
Show quoted text> which means that a switch in any of the time
> fields while processing the function would ruin the whole calculation.
Indeed - the the routine was entered on the cusp of a second. Not an
error I have ever seen, but now covered, at least in the instance I
found.
Show quoted text> Also, the dst calculation in _mktime_hms looks quite fragile.
How so? My limited understanding is the DST is either nil or +1 hour. I
assumed Perl would return 1 or 0 from localtime, but perlfunc reads:
$isdst is true if the specified time occurs during Daylight
Saving Time, false otherwise.
So I've adjusted accordingly:
($localtime[8]? 1 : 0)
Show quoted text> Maybe it
> would be better to use gmtime instead of localtime thoughout
> the module?
I don't think so, since that would break backwards compatibility.
Instead, I will try to find and fix the bug the smoketests found.
Thanks
Lee