[pypy-svn] r79750 - pypy/trunk/lib-python/modified-2.5.2/test

antocuni at codespeak.net antocuni at codespeak.net
Thu Dec 2 15:06:28 CET 2010


Author: antocuni
Date: Thu Dec  2 15:06:26 2010
New Revision: 79750

Added:
   pypy/trunk/lib-python/modified-2.5.2/test/seq_tests.py
      - copied, changed from r79749, pypy/trunk/lib-python/2.5.2/test/seq_tests.py
Log:
make this test working also on 64 bit


Copied: pypy/trunk/lib-python/modified-2.5.2/test/seq_tests.py (from r79749, pypy/trunk/lib-python/2.5.2/test/seq_tests.py)
==============================================================================
--- pypy/trunk/lib-python/2.5.2/test/seq_tests.py	(original)
+++ pypy/trunk/lib-python/modified-2.5.2/test/seq_tests.py	Thu Dec  2 15:06:26 2010
@@ -307,11 +307,19 @@
             self.assertEqual(id(s), id(s*1))
 
     def test_bigrepeat(self):
+        import sys
+        # 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__, 2**16)
+        self.assertRaises(MemoryError, x.__mul__, N)
         if hasattr(x, '__imul__'):
-            self.assertRaises(MemoryError, x.__imul__, 2**16)
+            self.assertRaises(MemoryError, x.__imul__, N)
 
     def test_subscript(self):
         a = self.type2test([10, 11])



More information about the Pypy-commit mailing list