[pypy-svn] r18222 - pypy/dist/pypy/objspace/std/test
arigo at codespeak.net
arigo at codespeak.net
Thu Oct 6 20:28:12 CEST 2005
Author: arigo
Date: Thu Oct 6 20:28:11 2005
New Revision: 18222
Modified:
pypy/dist/pypy/objspace/std/test/test_floatobject.py
pypy/dist/pypy/objspace/std/test/test_longobject.py
Log:
Fix tests for 64-bit machines.
Modified: pypy/dist/pypy/objspace/std/test/test_floatobject.py
==============================================================================
--- pypy/dist/pypy/objspace/std/test/test_floatobject.py (original)
+++ pypy/dist/pypy/objspace/std/test/test_floatobject.py Thu Oct 6 20:28:11 2005
@@ -61,7 +61,9 @@
import math
assert hash(42.0) == 42
assert hash(42.125) == 1413677056
- assert hash(math.ldexp(0.125, 1000)) == 32
+ assert hash(math.ldexp(0.125, 1000)) in (
+ 32, # answer on 32-bit machines
+ 137438953472) # answer on 64-bit machines
# testing special overflow values
assert hash(1e200 * 1e200) == 314159
assert hash(-1e200 * 1e200) == -271828
Modified: pypy/dist/pypy/objspace/std/test/test_longobject.py
==============================================================================
--- pypy/dist/pypy/objspace/std/test/test_longobject.py (original)
+++ pypy/dist/pypy/objspace/std/test/test_longobject.py Thu Oct 6 20:28:11 2005
@@ -393,8 +393,12 @@
assert hash(i) == hash(long(i))
# might check too much -- it's ok to change the hashing algorithm
assert hash(123456789L) == 123456789
- assert hash(1234567890123456789L) == -1895067127
- assert hash(-3**333) == -368329968
+ assert hash(1234567890123456789L) in (
+ -1895067127, # with 32-bit platforms
+ 1234567890123456789) # with 64-bit platforms
+ assert hash(-3**333) in (
+ -368329968, # with 32-bit platforms
+ 4437666303107791123) # with 64-bit platforms
def math_log(self):
import math
More information about the Pypy-commit
mailing list