DCIT / perl-CryptX

https://metacpan.org/pod/CryptX
Other
35 stars 23 forks source link

CPAN testers failure with Math::BigInt 1.999822 #73

Closed karel-m closed 3 years ago

karel-m commented 3 years ago
t/mbi_ltm_01load.t .................. 1/2 # Math::BigInt VERSION=1.999822
t/mbi_ltm_01load.t .................. ok
t/mbi_ltm_bigfltpm.t ................ ok
t/mbi_ltm_bigintg.t ................. ok
t/mbi_ltm_bigintpm.t ................ ok
t/mbi_ltm_biglog.t .................. 1/71
#   Failed test 'LTM loaded'
#   at t/mbi_ltm_biglog.t line 27.
#          got: 'Math::BigInt::Calc'
#     expected: 'Math::BigInt::LTM'
t/mbi_ltm_biglog.t .................. 71/71 # Looks like you failed 1 test of 71.
t/mbi_ltm_biglog.t .................. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/71 subtests
t/mbi_ltm_bigroot.t ................. 1/9
#   Failed test 'LTM loaded'
#   at t/mbi_ltm_bigroot.t line 22.
#          got: 'Math::BigInt::Calc'
#     expected: 'Math::BigInt::LTM'
# Looks like you failed 1 test of 9.
t/mbi_ltm_bigroot.t ................. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/9 subtests
t/mbi_ltm_bugs.t .................... ok
t/mbi_ltm_mbi-from-big-scalar.t ..... 1/12 # use64=1 ivsize=8 ivtype=long use64bitint=define
t/mbi_ltm_mbi-from-big-scalar.t ..... ok
t/mbi_ltm_storable.t ................ ok

@pjacklam do you have any idea what change in Math::BigInt could have an impact on Math::BigInt::LTM?

pjacklam commented 3 years ago

I made changes to Math::BigInt's import() method to avoid some warnings that appeared on MSWin32 systems. The changes I made do not cause problems with the backend libraries FastCalc, GMP, Pari, GMPz or BitVect, so I wonder what is causing problems with LTM. I don't know yet, but I am looking into it.

pjacklam commented 3 years ago

The test files t/mbi_ltm_biglog.t and t/mbi_ltm_bigroot.t contain

use Math::BigFloat only => 'LTM';
use Math::BigInt;

The first line causes the backend library Math::BigInt::LTM to be loaded, which is correct. However, when the second line is executed, Math::BigInt doesn't seem to recognize that Math::BigInt::LTM already has been loaded, so it loads the default library Math::BigInt::Calc. This is a bug.

Japhno commented 3 years ago

Confirmed.

use Math::BigInt lib => 'LTM';

fixes the bug in t/mbi_ltm_biglog.t and t/mbi_ltm_bigroot.t

Thanks @pjacklam ! :-)

pjacklam commented 3 years ago

The bug was not in t/mbi_ltm_biglog.t and t/mbi_ltm_bigroot.t, but in the most recent versions of the Math-BigInt distribution. I have just now uploaded a new version, Math-BigInt-1.999823.tar.gz. It includes a test to check for this specific case. From what I can see, the old tests pass now without adding the extra "lib => 'LTM'".