Re: [PATCH] Re: Lack of error for large string on Solaris
[p5sagit/p5-mst-13.2.git] / t / op / alarm.t
index 0dfc661..8fb9296 100644 (file)
@@ -29,7 +29,7 @@ my $diff = time - $start_time;
 
 # alarm time might be one second less than you said.
 is( $@, "ALARM!\n",             'alarm w/$SIG{ALRM} vs inf loop' );
-ok( $diff == 3 || $diff == 2,   '   right time' );
+ok( abs($diff - 3) <= 1,   "   right time" );
 
 
 my $start_time = time;
@@ -44,7 +44,8 @@ $diff = time - $start_time;
 # alarm time might be one second less than you said.
 is( $@, "ALARM!\n",             'alarm w/$SIG{ALRM} vs system()' );
 
-TODO: {
-    local $TODO = "alarm() can't stop a system call with \$SIG{ALRM} set";
-    ok( $diff == 3 || $diff == 2,   '   right time' );
+{
+    local $TODO = "Why does system() block alarm() on $^O?"
+               if $^O eq 'VMS' || $^O eq'MacOS' || $^O eq 'dos';
+    ok( abs($diff - 3) <= 1,   "   right time (waited $diff secs for 3-sec alarm)" );
 }