#300 pdl_from_string.t fails w/ BADVAL_USENAN=1

closed-fixed
David Mertens
core (120)
5
2012-05-19
2012-04-10
Diab Jerius
No

I always build PDL with BADVAL_USENAN=1. With the attached perldl.conf I get the following squawking from t/pdl_from_string.t

Argument "BAD" isn't numeric in numeric eq (==) at t/pdl_from_string.t line 163.
Argument "BAD" isn't numeric in numeric eq (==) at t/pdl_from_string.t line 163.
Looks like your perl asserts (incorrectly) that NaN == NaN
ok 29 # skip because perl's handling of NaN seems buggy
Argument "BAD" isn't numeric in numeric eq (==) at t/pdl_from_string.t line 173.
Argument "BAD" isn't numeric in numeric eq (==) at t/pdl_from_string.t line 173.
Argument "BAD" isn't numeric in multiplication (*) at t/pdl_from_string.t line 173.
not ok 30 - properly handles inf
# Failed test 'properly handles inf'
# at t/pdl_from_string.t line 173.
# First bad value should be inf but it describes itself as BAD
Argument "BAD" isn't numeric in numeric eq (==) at t/pdl_from_string.t line 177.
Argument "BAD" isn't numeric in numeric eq (==) at t/pdl_from_string.t line 177.
Argument "BAD" isn't numeric in multiplication (*) at t/pdl_from_string.t line 177.
not ok 31 - properly handles -inf
# Failed test 'properly handles -inf'
# at t/pdl_from_string.t line 177.
# Second bad value should be -inf but it describes itself as BAD
Argument "-BAD" isn't numeric in numeric eq (==) at t/pdl_from_string.t line 180.
Argument "BAD" isn't numeric in numeric eq (==) at t/pdl_from_string.t line 180.

This occurs on perl 5.10,

Discussion

  • Diab Jerius
    Diab Jerius
    2012-04-10

    Bug report continued (hit the wrong button)

    This bug occurs on perl 5.10.0, perl 5.12.2 on 64 bit CentOs 5.7, Debian 5, Debian 6, and Mac OS X 10.6.8

     
  • Diab Jerius
    Diab Jerius
    2012-04-10

     
    Attachments
  • Diab Jerius
    Diab Jerius
    2012-04-10

    Bug report contined ('cause my brain is mush today)

    This is for PDL version 2.4.10

     
  • David Mertens
    David Mertens
    2012-04-10

    • assigned_to: nobody --> run4flat
     
  • David Mertens
    David Mertens
    2012-04-10

    Hmm, I suppose some tests may fail if BADVAL == nan. I don't think there's an underlying problem with the handling of bad values in the pdl-from-string machinery, just that the tests are written under the assumption that nan != badvalue. I'll look over those and report my findings.

     
  • Chris Marshall
    Chris Marshall
    2012-04-11

    I get the same errors for a cygwin/XP build for perl 5.10.1

     
  • Sisyphus
    Sisyphus
    2012-04-12

    In t/pdl_from_string.t we do:

    my $bad_values = pdl q[nan inf -inf bad];

    which results in $bad_values being [BAD BAD BAD BAD] iff BADVALUE_USENAN==1.

    If that's the intended behaviour, then we need to skip those failing tests iff BADVALUE_USENAN==1 because there's now no way of knowing whether the BAD values in $bad_values derive from a 'nan', an 'inf' or a 'bad', and because perl will always numify the string 'BAD' to zero.

    Cheers,
    Rob

     
  • Chris Marshall
    Chris Marshall
    2012-05-19

    Bug fixed in Git.
    Thanks for reporting the problem!

     
  • Chris Marshall
    Chris Marshall
    2012-05-19

    • status: open --> closed-fixed