From: Steve Peters Date: Sat, 26 Nov 2005 12:48:42 +0000 (+0000) Subject: Deal with differences in what clock() does between POSIX and BSD. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=439787adcd53f9bf3c626f16cfde7d00fa72ed23;p=p5sagit%2Fp5-mst-13.2.git Deal with differences in what clock() does between POSIX and BSD. p4raw-id: //depot/perl@26213 --- diff --git a/ext/POSIX/t/time.t b/ext/POSIX/t/time.t index f975c68..8f372e5 100644 --- a/ext/POSIX/t/time.t +++ b/ext/POSIX/t/time.t @@ -4,7 +4,7 @@ use strict; use Config; use POSIX; -use Test::More qw(no_plan); +use Test::More tests => 9; # go to UTC to avoid DST issues around the world when testing. SUS3 says that # null should get you UTC, but some environments want the explicit names. @@ -42,9 +42,11 @@ if ($^O eq "MSWin32") { } setlocale(LC_TIME, $orig_loc) || die "Cannot setlocale() back to orig: $!"; -# Hard to test other than to make sure it returns something numeric and < 0 +# clock() seems to have different definitions of what it does between POSIX +# and BSD. Cygwin, Win32, and Linux lean the BSD way. So, the tests just +# check the basics. like(clock(), qr/\d*/, "clock() returns a numeric value"); -ok(clock() > 0, "...and its greater than zero"); +ok(clock() >= 0, "...and it returns something >= 0"); SKIP: { skip "No difftime()", 1 if $Config{d_difftime} ne 'define';