Subject: | undefined usleep() on Win32 in tests |
On Win32 (ActivePerl 802), in running the tests for Time-HiRes
version 1.81, I get an error
Undefined subroutine &main::usleep called at t/HiRes.t line 356
which results in tests 21-31 failing. I'm not sure if this is
the desired fix, but in the attached patch the fully qualified
Time::HiRes::usleep() is used instead in t/HiRes.t.
--- HiRes.t~ Sat Nov 5 03:25:20 2005
+++ HiRes.t Sat Nov 5 15:36:18 2005
@@ -353,7 +353,7 @@
}
$t0 = gettimeofday();
- $a = abs(usleep($sleep * 1E6) / ($sleep * 1E6) - 1.0);
+ $a = abs(Time::HiRes::usleep($sleep * 1E6) / ($sleep * 1E6) - 1.0);
$td = gettimeofday() - $t0;
$ratio = 1.0 + $a;
@@ -398,7 +398,7 @@
print $@ =~ /::sleep\(-1\): negative time not invented yet/ ?
"ok 24\n" : "not ok 24\n";
-eval { usleep(-2) };
+eval { Time::HiRes::usleep(-2) };
print $@ =~ /::usleep\(-2\): negative time not invented yet/ ?
"ok 25\n" : "not ok 25\n";