From: Dominic Dunlop Date: Fri, 13 Oct 2000 19:17:57 +0000 (+0200) Subject: op/sprintf.t patch for OS/390 (and any other host with limited X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f7137e37caaee9cb7b58305cc93e3aeeb9a32ab2;p=p5sagit%2Fp5-mst-13.2.git op/sprintf.t patch for OS/390 (and any other host with limited floating-point exponent length) Subject: Re: [ID 20001006.014] Not OK: perl v5.7.0 +DEVEL7158 on os390 05.00 (UNINSTALLED) [PATCH bleadperl] Message-Id: p4raw-id: //depot/perl@7225 --- diff --git a/t/op/sprintf.t b/t/op/sprintf.t index 1fda31e..22b0b48 100755 --- a/t/op/sprintf.t +++ b/t/op/sprintf.t @@ -56,8 +56,17 @@ for ($i = 1; @tests; $i++) { } elsif ($y eq ">$result<") # Some C libraries always give { # three-digit exponent - print("ok $i >$result< $x # three-digit exponent accepted\n"); + print("ok $i >$result< $x # three-digit exponent accepted\n"); } + elsif ($result =~ /[-+]\d{3}$/ && + # Suppress tests with modulo of exponent >= 100 on platforms + # which can't handle such magnitudes (or where we can't tell). + ((!eval {require POSIX}) || # Costly: only do this if we must! + (length(&POSIX::DBL_MAX) - rindex(&POSIX::DBL_MAX, '+')) == 3)) + { + print("ok $i >$template< >$data< >$result<", + " # Suppressed: exponent out of range?\n") + } else { $y = ($x eq $y ? "" : " => $y"); print("not ok $i >$template< >$data< >$result< $x$y",