[Patches] rint test in test_math.py fails on Win32
Trent Mick
trentm@activestate.com
Fri, 12 May 2000 11:50:49 -0700
Rationale:
With the conditional addition of math.rint the test in test_math has to be
made tolerant of rint not being defined for a platform (e.g. Win32, Win64).
This patch does that.
Legal:
I confirm that, to the best of my knowledge and belief, this
contribution is free of any claims of third parties under
copyright, patent or other rights or interests ("claims"). To
the extent that I have any such claims, I hereby grant to CNRI a
nonexclusive, irrevocable, royalty-free, worldwide license to
reproduce, distribute, perform and/or display publicly, prepare
derivative versions, and otherwise use this contribution as part
of the Python software and its related documentation, or any
derivative versions thereof, at no cost to CNRI or its licensed
users, and to authorize others to do so.
I acknowledge that CNRI may, at its sole discretion, decide
whether or not to incorporate this contribution in the Python
software and its related documentation. I further grant CNRI
permission to use my name and other identifying information
provided to CNRI by me for use in connection with the Python
software and its related documentation.
Patch:
diff -c3 /home/trentm/main/contrib/python/dist/src/Lib/test/test_math.py /home/trentm/main/Apps/Perlium/Python/dist/src/Lib/test/test_math.py
*** /home/trentm/main/contrib/python/dist/src/Lib/test/test_math.py Fri May 12 10:08:39 2000
--- /home/trentm/main/Apps/Perlium/Python/dist/src/Lib/test/test_math.py Fri May 12 11:20:15 2000
***************
*** 130,139 ****
testit('pow(2,-1)', math.pow(2,-1), 0.5)
print 'rint'
! testit('rint(0.7)', math.rint(0.7), 1)
! testit('rint(-0.3)', math.rint(-0.3), 0)
! testit('rint(2.5)', math.rint(2.5), 2)
! testit('rint(3.5)', math.rint(3.5), 4)
print 'sin'
testit('sin(0)', math.sin(0), 0)
--- 130,143 ----
testit('pow(2,-1)', math.pow(2,-1), 0.5)
print 'rint'
! try:
! testit('rint(0.7)', math.rint(0.7), 1)
! testit('rint(-0.3)', math.rint(-0.3), 0)
! testit('rint(2.5)', math.rint(2.5), 2)
! testit('rint(3.5)', math.rint(3.5), 4)
! except AttributeError:
! # this platform does not have rint, that is fine, skip the test
! pass
print 'sin'
testit('sin(0)', math.sin(0), 0)
--
Trent Mick
trentm@activestate.com