diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2000-01-17 08:35:49 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-01-17 08:35:49 +0000 |
commit | fc68435e3bc2319d16a41401118f9f6c9632e3c0 (patch) | |
tree | 50ad4025082c3d2f7247d51e7126f896d72b2220 /t | |
parent | 38192672c8214bacabd25e094d76f7e2728d5de6 (diff) | |
download | perl-fc68435e3bc2319d16a41401118f9f6c9632e3c0.tar.gz |
Add -D_GNU_SOURCE into ccflags for gcc (for now to expose
the strtold() and qgcvt() prototypes for long doubles, but
it should be okay in any case); fix bad assumptions in the
test suite about string->float conversions; though the out
parameter of strtold() (and strtoll()) is unused, it is nicer
to have it in correct type.
p4raw-id: //depot/cfgperl@4810
Diffstat (limited to 't')
-rwxr-xr-x | t/lib/posix.t | 3 | ||||
-rwxr-xr-x | t/op/pack.t | 5 |
2 files changed, 7 insertions, 1 deletions
diff --git a/t/lib/posix.t b/t/lib/posix.t index 7fb5f62177..10c06becbf 100755 --- a/t/lib/posix.t +++ b/t/lib/posix.t @@ -72,6 +72,9 @@ print getcwd() =~ m#/t$# ? "ok 13\n" : "not ok 13\n"; if ($Config{d_strtod}) { $lc = &POSIX::setlocale(&POSIX::LC_NUMERIC, 'C') if $Config{d_setlocale}; ($n, $x) = &POSIX::strtod('3.14159_OR_SO'); +# Using long double NVs may introduce greater accuracy than wanted. + $n =~ s/^3.14158999\d*$/3.14159/ + if $Config{uselongdouble} eq 'define'; print (($n == 3.14159) && ($x == 6) ? "ok 14\n" : "not ok 14\n"); &POSIX::setlocale(&POSIX::LC_NUMERIC, $lc) if $Config{d_setlocale}; } else { print "# strtod not present\n", "ok 14\n"; } diff --git a/t/op/pack.t b/t/op/pack.t index 2d34311f1f..867da8dd14 100755 --- a/t/op/pack.t +++ b/t/op/pack.t @@ -19,7 +19,10 @@ print ($#ary == $#ary2 ? "ok 1\n" : "not ok 1\n"); $out1=join(':',@ary); $out2=join(':',@ary2); -print ($out1 eq $out2 ? "ok 2\n" : "not ok 2\n"); +# Using long double NVs may introduce greater accuracy than wanted. +$out2 =~ s/:9\.87654321097999\d*:/:9.87654321098:/ + if $Config{uselongdouble} eq 'define'; +print ($out1 eq $out2? "ok 2\n" : "not ok 2\n"); print ($foo =~ /def/ ? "ok 3\n" : "not ok 3\n"); |