[pypy-svn] r32269 - pypy/dist/pypy/translator/asm/ppcgen/test
arigo at codespeak.net
arigo at codespeak.net
Wed Sep 13 17:56:52 CEST 2006
Author: arigo
Date: Wed Sep 13 17:56:50 2006
New Revision: 32269
Modified:
pypy/dist/pypy/translator/asm/ppcgen/test/test_field.py
Log:
The maximum value for a PPC int is not always sys.maxint.
Modified: pypy/dist/pypy/translator/asm/ppcgen/test/test_field.py
==============================================================================
--- pypy/dist/pypy/translator/asm/ppcgen/test/test_field.py (original)
+++ pypy/dist/pypy/translator/asm/ppcgen/test/test_field.py Wed Sep 13 17:56:50 2006
@@ -4,23 +4,24 @@
from py.test import raises
import random
-import sys
+
+maxppcint = 0x7fffffff
class TestFields(object):
def test_decode(self):
# this test is crappy
field = Field("test", 0, 31)
for i in range(100):
- j = random.randrange(sys.maxint)
+ j = random.randrange(maxppcint)
assert field.decode(j) == j
field = Field("test", 0, 31-4)
for i in range(100):
- j = random.randrange(sys.maxint)
+ j = random.randrange(maxppcint)
assert field.decode(j) == j>>4
assert field.decode(j) == j>>4
field = Field("test", 3, 31-4)
for i in range(100):
- j = random.randrange(sys.maxint>>3)
+ j = random.randrange(maxppcint>>3)
assert field.decode(j) == j>>4
More information about the Pypy-commit
mailing list