Menu

#393 Tests may fail if perl is compiled with -Duselongdouble

normal
closed
None
5
2016-10-08
2015-06-24
No

The t/limits_trans_err.t test fails on a debian/wheezy system if perl is compiled with -Duselongdouble (checked with perl 5.20.1):

#   Failed test 'x symmetric trans'
#   at t/limits_trans_err.t line 30.
#     Structures begin differing at:
#          $got->[0] = '-0.301029995663981198'
#     $expected->[0] = '-0.301029995663981195'

#   Failed test 'x asymmetric trans'
#   at t/limits_trans_err.t line 35.
#     Structures begin differing at:
#          $got->[0] = '-0.301029995663981198'
#     $expected->[0] = '-0.301029995663981195'

#   Failed test 'illegal errbar lower bounds'
#   at t/limits_trans_err.t line 42.
#     Structures begin differing at:
#          $got->[0] = '-0.301029995663981198'
#     $expected->[0] = '-0.301029995663981195'
# Looks like you failed 3 tests of 3.
t/limits_trans_err.t ............

On a FreeBSD 10 system the test suite also fails if perl is compiled with -Duselongdouble, but a different test:

#   Failed test 'q[e] returns exp(1)'
#   at t/pdl_from_string.t line 301.
#          got: '2.71828182845904509'
#     expected: '2.71828182845904553'
# Got 2.71828182845904509

#   Failed test 'q[E] returns exp(1)'
#   at t/pdl_from_string.t line 304.
#          got: '2.71828182845904509'
#     expected: '2.71828182845904553'
# Got 2.71828182845904509
# Looks like you failed 2 tests of 113.
t/pdl_from_string.t ............. 
Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/113 subtests 
        (less 1 skipped subtest: 110 okay)
        (3 TODO tests unexpectedly succeeded)

Regards,
Slaven

Discussion

  • Chris Marshall

    Chris Marshall - 2015-08-10

    Thanks for reporting the problem. We're in the process of cleaning up the tests and changing floating point comparisons for equality to numerical equality with an allowed tolerance is part of that.

     
  • Chris Marshall

    Chris Marshall - 2015-08-15
    • assigned_to: Zakariyya Mughal
     
  • Chris Marshall

    Chris Marshall - 2015-08-15

    Adding this to the list of test fixes for PDL. Sivoais may already have addressed these.

     
  • Chris Marshall

    Chris Marshall - 2015-08-16
    • Group: critical --> normal
     
  • Chris Marshall

    Chris Marshall - 2015-09-29

    I don't see an easy way to add approximate equality to the current tests. I suggest marking them TODO again for PDL-2.014.

     
  • Chris Marshall

    Chris Marshall - 2015-10-02

    kmx has pointed out that there are some CPAN modules that could be used to fix the problem and the expense of additional PDL dependencies. Thoughts?

     
  • Chris Marshall

    Chris Marshall - 2015-10-05
     
  • Chris Marshall

    Chris Marshall - 2015-10-05

    The problem tests are marked TODO and I'm lowering the priority as this is not needed for PDL-2.014.

     
  • Chris Marshall

    Chris Marshall - 2016-09-18
    • status: open --> pending-fixed
     
  • Chris Marshall

    Chris Marshall - 2016-09-18

    Replaced is() by ok( approx($x,$y,1e-15). Now the difference between the results between perls with uselongdouble set and the PDL double type (which is the only one supported) shouldn't matter. Need to check on a long double perl system.

     
  • Chris Marshall

    Chris Marshall - 2016-10-08
    • status: pending-fixed --> closed
     

Log in to post a comment.