[pypy-svn] r79792 - pypy/branch/fast-forward/lib-python/modified-2.7.0/test
afa at codespeak.net
afa at codespeak.net
Fri Dec 3 19:14:04 CET 2010
Author: afa
Date: Fri Dec 3 19:14:03 2010
New Revision: 79792
Added:
pypy/branch/fast-forward/lib-python/modified-2.7.0/test/seq_tests.py
- copied, changed from r79790, pypy/branch/fast-forward/lib-python/2.7.0/test/seq_tests.py
Log:
Port r79750 to the 2.7 test suite
Copied: pypy/branch/fast-forward/lib-python/modified-2.7.0/test/seq_tests.py (from r79790, pypy/branch/fast-forward/lib-python/2.7.0/test/seq_tests.py)
==============================================================================
--- pypy/branch/fast-forward/lib-python/2.7.0/test/seq_tests.py (original)
+++ pypy/branch/fast-forward/lib-python/modified-2.7.0/test/seq_tests.py Fri Dec 3 19:14:03 2010
@@ -307,12 +307,18 @@
def test_bigrepeat(self):
import sys
- if sys.maxint <= 2147483647:
- x = self.type2test([0])
- x *= 2**16
- self.assertRaises(MemoryError, x.__mul__, 2**16)
- if hasattr(x, '__imul__'):
- self.assertRaises(MemoryError, x.__imul__, 2**16)
+ # we chose an N such as 2**16 * N does not fit into a cpu word
+ if sys.maxint == 2147483647:
+ # 32 bit system
+ N = 2**16
+ else:
+ # 64 bit system
+ N = 2**48
+ x = self.type2test([0])
+ x *= 2**16
+ self.assertRaises(MemoryError, x.__mul__, N)
+ if hasattr(x, '__imul__'):
+ self.assertRaises(MemoryError, x.__imul__, N)
def test_subscript(self):
a = self.type2test([10, 11])
More information about the Pypy-commit
mailing list