DCIT / perl-CryptX

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

Tests failure with Math::BigInt >= 1.999840 #96

Closed xavierba closed 1 year ago

xavierba commented 1 year ago

Hi,

CryptX fails at some test when built against Math::BigInt >= 1.999840

# Math::BigInt VERSION=1.999841
t/mbi_ltm_01load.t .................. ok
#   Failed test '$x = Math::BigFloat->new("1"); $y = Math::BigFloat->new("1"); $x >> $y;'
#   at ./t/mbi_ltm/bigfltpm.inc line 168.
#          got: '0'
#     expected: '0.5'
#   Failed test '$x = Math::BigFloat->new("123"); $y = Math::BigFloat->new("1"); $x >> $y;'
#   at ./t/mbi_ltm/bigfltpm.inc line 168.
#          got: '61'
#     expected: '61.5'
#   Failed test '$x = Math::BigFloat->new("2"); $y = Math::BigFloat->new("18.2"); $x <<= $y; $x->copy()->bfround(-9);'
#   at ./t/mbi_ltm/bigfltpm.inc line 502.
#          got: '524288.000000000'
#     expected: '602248.763144685'
# Looks like you failed 3 tests of 2396.
t/mbi_ltm_bigfltpm.t ................ 
Dubious, test returned 3 (wstat 768, 0x300)
Failed 3/2396 subtests 
        (less 1 skipped subtest: 2392 okay)
t/mbi_ltm_bigintg.t ................. ok
#   Failed test '$x = Math::BigInt->new("+8"); $y = Math::BigInt->new("-2"); $x << $y;'
#   at ./t/mbi_ltm/bigintpm.inc line 202.
#          got: '2'
#     expected: 'NaN'
#   Failed test '$x = Math::BigInt->new("+1234"); $y = Math::BigInt->new("-3"); $x->blsft($y, 10);'
#   at ./t/mbi_ltm/bigintpm.inc line 202.
#          got: '1'
#     expected: 'NaN'
#   Failed test '$x = Math::BigInt->new("+2"); $y = Math::BigInt->new("-2"); $x >> $y;'
#   at ./t/mbi_ltm/bigintpm.inc line 202.
#          got: '8'
#     expected: 'NaN'
#   Failed test '$x = Math::BigInt->new("+1234"); $y = Math::BigInt->new("-3"); $x->brsft($y, 10);'
#   at ./t/mbi_ltm/bigintpm.inc line 202.
#          got: '1234000'
#     expected: 'NaN'
# Looks like you failed 4 tests of 3718.
t/mbi_ltm_bigintpm.t ................ 
Dubious, test returned 4 (wstat 1024, 0x400)
Failed 4/3718 subtests 
        (less 50 skipped subtests: 3664 okay)

From Math::BigInt 1.999840 changelog:

This was initially reported by Petr Pisar at: https://bugzilla.redhat.com/show_bug.cgi?id=2240587

karel-m commented 1 year ago

Already fixed in the latest devel version CryptX-0.079_004

xavierba commented 1 year ago

Thanks for the quick answer. I confirm that 62fde623598a7d04081fc63bc992c0d860e875df fixes the issue. However, I believe t/mbi_ltm_since_1.999842.t should be run for Math::BigInt 1.999840 and later, and thus be renamed and tweaked accordingly.