sanko / Affix.pm

A Foreign Function Interface eXtension for Perl
https://metacpan.org/dist/Affix
Artistic License 2.0
1 stars 0 forks source link

Fails with -Duselongdouble #5

Closed eserte closed 1 year ago

eserte commented 1 year ago

t/02_sin.t fails with perls compiled with -Duselongdouble:

# Loading /lib64/libm.so.6 ...

#   Failed test 'sin(30) [perl]'
#   at t/02_sin.t line 39.
#          got: '-0.98803162409286179'
#     expected: '-0.988031624092862'
# Attached sin_ellipsis

#   Failed test 'Dyn::call( ... ) [sin_ellipsis]'
#   at t/02_sin.t line 46.
#          got: '-0.988031624092861827'
#     expected: '-0.988031624092862'
# Attached sin_cdecl
... etc ...
#   Failed test 'Dyn::call( ... ) [sin_vararg]'
#   at t/02_sin.t line 46.
#          got: '-0.988031624092861827'
#     expected: '-0.988031624092862'
# Looks like you failed 8 tests of 8.
t/02_sin.t ....... 
Dubious, test returned 8 (wstat 2048, 0x800)
Failed 8/8 subtests 

See also http://matrix.cpantesters.org/?dist=Dyn%200.03;os=linux;reports=1 for an overview (fail reports mostly with ld and quadmath systems).

sanko commented 1 year ago

I wasn't testing the actual value (just making sure a float was being returned at all) but platform issues like this could be a headache down the road so I wrote a Github Action that caches custom builds of perl on osx, windows, and ubuntu with various flags to make sure long double doesn't trip us up.