This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
op/sprintf.t patch for OS/390 (and any other host with limited
authorDominic Dunlop <domo@computer.org>
Fri, 13 Oct 2000 19:17:57 +0000 (21:17 +0200)
committerJarkko Hietaniemi <jhi@iki.fi>
Fri, 13 Oct 2000 22:11:31 +0000 (22:11 +0000)
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: <p04320400b60cf2a6a05c@[192.168.1.4]>

p4raw-id: //depot/perl@7225

t/op/sprintf.t

index 1fda31e..22b0b48 100755 (executable)
@@ -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",