[pypy-svn] r14070 - pypy/branch/dist-2.4.1/lib-python/modified-2.4.1/test

nik at codespeak.net nik at codespeak.net
Fri Jul 1 21:19:47 CEST 2005


Author: nik
Date: Fri Jul  1 21:19:46 2005
New Revision: 14070

Added:
   pypy/branch/dist-2.4.1/lib-python/modified-2.4.1/test/test_struct.py
      - copied, changed from r14047, pypy/branch/dist-2.4.1/lib-python/2.4.1/test/test_struct.py
Log:
Applied modifications from 2.3.4 to 2.4.1 version of test_struct.py


Copied: pypy/branch/dist-2.4.1/lib-python/modified-2.4.1/test/test_struct.py (from r14047, pypy/branch/dist-2.4.1/lib-python/2.4.1/test/test_struct.py)
==============================================================================
--- pypy/branch/dist-2.4.1/lib-python/2.4.1/test/test_struct.py	(original)
+++ pypy/branch/dist-2.4.1/lib-python/modified-2.4.1/test/test_struct.py	Fri Jul  1 21:19:46 2005
@@ -329,16 +329,25 @@
         from random import randrange
 
         # Create all interesting powers of 2.
-        values = []
+        allvalues = []
         for exp in range(self.bitsize + 3):
-            values.append(1L << exp)
+            allvalues.append(1L << exp)
 
-        # Add some random values.
-        for i in range(self.bitsize):
-            val = 0L
-            for j in range(self.bytesize):
-                val = (val << 8) | randrange(256)
-            values.append(val)
+        # reduce the number of values again 
+        values = []
+        i = 1
+        while i <= len(allvalues): 
+            values.append(allvalues[i-1])
+            i *= 2
+
+        #
+        # XXX doesn't seem like good practice to run with random values 
+        #
+        #for i in range(self.bitsize):
+        #    val = 0L
+        #    for j in range(self.bytesize):
+        #        val = (val << 8) | randrange(256)
+        #    values.append(val)
 
         # Try all those, and their negations, and +-1 from them.  Note
         # that this tests all power-of-2 boundaries in range, and a few out



More information about the Pypy-commit mailing list