[inseparable changes from patch from perl5.003_15 to perl5.003_16]
[p5sagit/p5-mst-13.2.git] / t / op / time.t
index 6d23832..1bec442 100755 (executable)
@@ -2,7 +2,8 @@
 
 # $RCSfile: time.t,v $$Revision: 4.1 $$Date: 92/08/07 18:28:32 $
 
-print "1..5\n";
+if ($does_gmtime = gmtime(time)) { print "1..5\n" }
+else { print "1..3\n" }
 
 ($beguser,$begsys) = times;
 
@@ -14,7 +15,8 @@ if ($now > $beg && $now - $beg < 10){print "ok 1\n";} else {print "not ok 1\n";}
 
 for ($i = 0; $i < 100000; $i++) {
     ($nowuser, $nowsys) = times;
-    $i = 200000 if $nowuser > $beguser && $nowsys > $begsys;
+    $i = 200000 if $nowuser > $beguser && ( $nowsys > $begsys || 
+                                            (!$nowsys && !$begsys));
     last if time - $beg > 20;
 }
 
@@ -29,6 +31,8 @@ if ($sec != $xsec && $mday && $year)
 else
     {print "not ok 3\n";}
 
+exit 0 unless $does_gmtime;
+
 ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime($beg);
 ($xsec,$foo) = localtime($now);
 
@@ -37,7 +41,7 @@ if ($sec != $xsec && $mday && $year)
 else
     {print "not ok 4\n";}
 
-if (index(" :0:1:-1:365:366:-365:-366:",':' . ($localyday - $yday) . ':') > 0)
+if (index(" :0:1:-1:364:365:-364:-365:",':' . ($localyday - $yday) . ':') > 0)
     {print "ok 5\n";}
 else
     {print "not ok 5\n";}