summaryrefslogtreecommitdiff
path: root/lib/Time
diff options
context:
space:
mode:
authorMichael G. Schwern <schwern@pobox.com>2008-10-04 18:24:54 -0400
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2009-01-03 18:39:16 +0100
commit461d5a49bcaf1bdc023edb10ef9b6c0606ec0131 (patch)
treeb320c5fc7d5618b148e9437543445ba6ec23e764 /lib/Time
parentb86b480f7301a8816081189c89b366a79ab9909f (diff)
downloadperl-461d5a49bcaf1bdc023edb10ef9b6c0606ec0131.tar.gz
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.
Diffstat (limited to 'lib/Time')
-rw-r--r--lib/Time/gmtime.t3
-rw-r--r--lib/Time/localtime.t5
2 files changed, 3 insertions, 5 deletions
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