fuzzylogician / gmpy

Automatically exported from code.google.com/p/gmpy
GNU Lesser General Public License v3.0
0 stars 0 forks source link

3 tests fail on 32-bit systems #91

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. On a 32-bit system, build and run "python test/runtests.py"

What is the expected output? What do you see instead?
With 2.0.3, the tests passed, but with 2.0.4, I get this instead:

Unit tests for gmpy2 2.0.4 with Python 2.7.8
  Mutliple-precision library:     GMP 6.0.0
  Floating-point library:         MPFR 3.1.2
  Complex library:                MPC 1.0.2
  Caching Values: (Cache size)    100
  Caching Values: (Size in limbs) 128
Results for:  test_context             Attempted:   35   Failed:    0
Results for:  test_misc                Attempted:   11   Failed:    0
Results for:  test_mpc                 Attempted:   86   Failed:    0
Results for:  test_mpc_to_from_binary  Attempted:   41   Failed:    0
Results for:  test_mpfr                Attempted:  175   Failed:    0
Results for:  test_mpfr_min_max        Attempted:   26   Failed:    0
Results for:  test_mpfr_to_from_binary Attempted:   25   Failed:    0
**********************************************************************
File "test/test_mpfr_trig.txt", line 308, in test_mpfr_trig.txt
Failed example:
    gmpy2.cot(mpfr("0.2")).as_integer_ratio()
Expected:
    (mpz(173569956714485), mpz(35184372088832))
Got:
    (mpz(173569956714485L), mpz(35184372088832L))
**********************************************************************
File "test/test_mpfr_trig.txt", line 310, in test_mpfr_trig.txt
Failed example:
    (1/math.tan(0.2)).as_integer_ratio()
Expected:
    (5554238614863519, 1125899906842624)
Got:
    (5554238614863519L, 1125899906842624L)
**********************************************************************
1 items had failures:
   2 of 110 in test_mpfr_trig.txt
***Test Failed*** 2 failures.
Results for:  test_mpfr_trig           Attempted:  110   Failed:    2
Results for:  test_mpq                 Attempted:  160   Failed:    0
Results for:  test_mpq_to_from_binary  Attempted:    6   Failed:    0
Results for:  test_mpz                 Attempted:  199   Failed:    0
**********************************************************************
File "test/test_mpz_io.txt", line 71, in test_mpz_io.txt
Failed example:
    mpz(D("1e10"))
Expected:
    mpz(10000000000)
Got:
    mpz(10000000000L)
**********************************************************************
1 items had failures:
   1 of  68 in test_mpz_io.txt
***Test Failed*** 1 failures.
Results for:  test_mpz_io              Attempted:   68   Failed:    1
Results for:  test_mpz_pack_unpack     Attempted:   16   Failed:    0
Results for:  test_mpz_to_from_binary  Attempted:    6   Failed:    0
                             Summary - Attempted:  964   Failed:    3

What version of the product are you using? On what operating system?
2.0.4, on Fedora Linux (Rawhide) i386

Please provide any additional information below.

Original issue reported on code.google.com by loganje...@gmail.com on 13 Oct 2014 at 9:07

GoogleCodeExporter commented 8 years ago
This only happens with python 2.  The tests pass as-is with python 3.

Original comment by loganje...@gmail.com on 13 Oct 2014 at 9:40

GoogleCodeExporter commented 8 years ago
Hi,

The errors are purely formatting. Python 2 appends a trailing L when integer 
values are sufficient large. I do most of my development on 64-bit systems 
where the cutoff is different. I'm not sure how/why the change slipped in.

Is this a significant issue for you? (In other words, how soon do I need to 
make a new release?)

Thanks for the report.

Case

Original comment by casevh on 14 Oct 2014 at 4:14

GoogleCodeExporter commented 8 years ago
Don't worry about a new release.  I maintain the gmpy2 package for the Fedora 
Linux distribution, and the one build failed, which is how I noticed this.  I 
just added a patch to change the expected test values for the python 2 32-bit 
case, and now we're good.

Original comment by loganje...@gmail.com on 14 Oct 2014 at 7:10

GoogleCodeExporter commented 8 years ago
I've committed a fix (r1014) to the gmpy2_maint branch. 

Thanks for maintaining the Fedora package.

Case

Original comment by casevh on 1 Nov 2014 at 5:21