Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix failing test TEST_RT66882 in t/SF.t #204

Open
hakonhagland opened this issue Jun 12, 2020 · 0 comments
Open

Fix failing test TEST_RT66882 in t/SF.t #204

hakonhagland opened this issue Jun 12, 2020 · 0 comments

Comments

@hakonhagland
Copy link
Contributor

hakonhagland commented Jun 12, 2020

See previous discussion in #176. I open a new issue here since the discussion in #176 also involved another failing test and I think it is becoming difficult to get an overview.

So this issue is about the first failed test for perl 5.20.1 on FreeBSD, it says:

t/SF.t           (Wstat: 0 Tests: 1074 Failed: 1)
  Failed test:  22

It I try run the SF.t test by it self:

$ prove -lv  t/SF.t
[...]
ok 22 - gsl_sf_fermi_dirac_m1_e(10.0, $r) ?= 0.999954602131298, # TODO loss of precision on Perls with DUSELONGDOUBLE
# res= +-0, eps=2.21777808290173e-17
# 
[...]

So test #22 in SF.t seems to be this one TEST_RT66882:

sub TEST_RT66882 : Tests {
    # This test was losing a small amount of precision with
    # perls that have DUSELONGDOUBLE, so give it some leeway
    # Where is the loss of precision coming from? Is it a bug in Perl, GSL or Math::GSL ?
    # A beer if you figure it out.
    # why doesn't $TODO work here?
    local $TODO = "loss of precision on Perls with DUSELONGDOUBLE";

    # additional diagnostics
    local %ENV; $ENV{DEBUG} = 1;
    my $results = {
        'gsl_sf_fermi_dirac_m1_e(10.0, $r)' => 0.9999546021312975656,
    };
    verify_results($results, 'Math::GSL::SF', 1e-16);
}

The RT ticket: Fails on perls compiled with -Duselongdouble. The strange thing is that it is already a TODO test and as the comment says "why doesn't $TODO work here?"

I sent an email to the cpantester Slaven Rezic regarding this failed test, and I got the following response:

Hello Håkon,

The full output of this test case is
# result->err: 2.21777808290172611e-19
# result->val: 0.99995460213129761
# expected   : 0.999954602131297566
# difference : 4.401860820291148e-17
# unexpected error of 2.18408273738942189e-17
not ok 22 - gsl_sf_fermi_dirac_m1_e(10.0, $r) ?= 0.99995460213129761,
# res= +-4.401860820291148e-17, eps=2.21777808290172611e-17 # TODO loss of precision on Perls with DUSELONGDOUBLE
#   Failed (TODO) test 'gsl_sf_fermi_dirac_m1_e(10.0, $r) ?= 0.99995460213129761,
# res= +-4.401860820291148e-17, eps=2.21777808290172611e-17'
#   at t/SF.t line 43.
#   (in Math::GSL::SF::Test->TEST_RT66882)
#     '4.401860820291148e-17'
#         <=
#     '2.21777808290172611e-17'

So there's a "TODO" indication, but IMHO on the wrong line --- it should be on the the same line as the corresponding "not ok".

Some tests later there's a TODO indication which works:
not ok 1073 - gsl_sf_bessel_kl_scaled_array(1,1) lives  # TODO gsl_sf_bessel_kl_scaled_array is missing
#   Failed (TODO) test 'gsl_sf_bessel_kl_scaled_array(1,1) lives '
#   at t/SF.t line 1341.
#   (in Math::GSL::SF::Test->TEST_ZBESSEL_ARRAYS)
# died: Undefined subroutine &Math::GSL::SF::gsl_sf_bessel_kl_scaled_array called at t/SF.t line 1340.

Regards,
    Slaven
hakonhagland added a commit to hakonhagland/math--gsl that referenced this issue Jun 12, 2020
Temporary fix for failed test for perl  5.20.1 on FreeBSD. This test
should actually never fail since it is marked as TODO. But still it
somehow failed on FreeBSD. By commenting out the code that fails we
force the test to succeed (i.e. not to be run).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant