From 461d5a49bcaf1bdc023edb10ef9b6c0606ec0131 Mon Sep 17 00:00:00 2001 From: "Michael G. Schwern" Date: Sat, 4 Oct 2008 18:24:54 -0400 Subject: Update from y2038. Add trace code. Fix implied negative time in localtie64_r(). This fixes Windows. Put in some more tests around small negative and positive times to try and catch the above. Explain the loss of accuracy due to use of doubles in perlport. --- lib/Time/gmtime.t | 3 +-- lib/Time/localtime.t | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'lib/Time') diff --git a/lib/Time/gmtime.t b/lib/Time/gmtime.t index 1ccd7fb826..9c77f81570 100644 --- a/lib/Time/gmtime.t +++ b/lib/Time/gmtime.t @@ -9,7 +9,7 @@ BEGIN { my(@times, @methods); BEGIN { - @times = (-2**33, -2**31-1, 0, 2**31-1, 2**33, time); + @times = (-2**62, -2**50, -2**33, -2**31-1, -1, 0, 1, 2**31-1, 2**33, 2**50, 2**62, time); @methods = qw(sec min hour mday mon year wday yday isdst); plan tests => (@times * @methods) + 1; @@ -17,7 +17,6 @@ BEGIN { use_ok Time::gmtime; } -# Perl has its own gmtime() so it's safe to do negative times. for my $time (@times) { my $gmtime = gmtime $time; # This is the OO gmtime. my @gmtime = CORE::gmtime $time; # This is the gmtime function diff --git a/lib/Time/localtime.t b/lib/Time/localtime.t index 8600eff3e7..f300343ff8 100644 --- a/lib/Time/localtime.t +++ b/lib/Time/localtime.t @@ -7,8 +7,9 @@ BEGIN { require "./test.pl"; } +my(@times, @methods); BEGIN { - @times = (-2**33, -2**31-1, 0, 2**31-1, 2**33, time); + @times = (-2**62, -2**50, -2**33, -2**31-1, -1, 0, 1, 2**31-1, 2**33, 2**50, 2**62, time); @methods = qw(sec min hour mday mon year wday yday isdst); plan tests => (@times * @methods) + 1; @@ -16,8 +17,6 @@ BEGIN { use_ok Time::localtime; } -# Since Perl's localtime() still uses the system localtime, don't try -# to do negative times. The system might not support it. for my $time (@times) { my $localtime = localtime $time; # This is the OO localtime. my @localtime = CORE::localtime $time; # This is the localtime function -- cgit v1.2.1