Fixed test failure on Win64 machines.
authorRobert Schuppenies <okkotonushi@googlemail.com>
Mon, 14 Jul 2008 08:42:18 +0000 (08:42 +0000)
committerRobert Schuppenies <okkotonushi@googlemail.com>
Mon, 14 Jul 2008 08:42:18 +0000 (08:42 +0000)
Lib/test/test_sys.py

index 12ba113eaefddd81591bc9ca7e1d1a9dc615aaf8..35467e46f62905e75404b65f2f652fa97d5f47c6 100644 (file)
@@ -511,9 +511,9 @@ class SizeofTest(unittest.TestCase):
         # method-wrapper (descriptor object)
         check({}.__iter__, size(h + '2P'))
         # dict
-        check({}, size(h + '3P2P') + 8*size('P2P'))
+        check({}, size(h + '3P2P' + 8*'P2P'))
         x = {1:1, 2:2, 3:3, 4:4, 5:5, 6:6, 7:7, 8:8}
-        check(x, size(h + '3P2P') + (8+16)*size('P2P'))
+        check(x, size(h + '3P2P' + 8*'P2P') + 16*size('P2P'))
         # dictionary-keyiterator
         check({}.iterkeys(), size(h + 'P2PPP'))
         # dictionary-valueiterator
@@ -542,9 +542,7 @@ class SizeofTest(unittest.TestCase):
         nfrees = len(x.f_code.co_freevars)
         extras = x.f_code.co_stacksize + x.f_code.co_nlocals +\
                  ncells + nfrees - 1
-        check(x, size(vh + '12P3i') +\
-                              CO_MAXBLOCKS*struct.calcsize('3i') +\
-                              self.P + extras*self.P)
+        check(x, size(vh + '12P3i' + CO_MAXBLOCKS*'3i' + 'P' + extras*'P'))
         # function
         def func(): pass
         check(func, size(h + '9P'))
@@ -612,8 +610,7 @@ class SizeofTest(unittest.TestCase):
         # frozenset
         PySet_MINSIZE = 8
         samples = [[], range(10), range(50)]
-        s = size(h + '3P2P') +\
-            PySet_MINSIZE*struct.calcsize('lP') + self.l + self.P
+        s = size(h + '3P2P' + PySet_MINSIZE*'lP' + 'lP')
         for sample in samples:
             minused = len(sample)
             if minused == 0: tmp = 1
@@ -646,7 +643,7 @@ class SizeofTest(unittest.TestCase):
         # type
         # (PyTypeObject + PyNumberMethods +  PyMappingMethods +
         #  PySequenceMethods + PyBufferProcs)
-        s = size('P2P15Pl4PP9PP11PI') + size(vh + '41P 10P 3P 6P')
+        s = size(vh + 'P2P15Pl4PP9PP11PI') + size('41P 10P 3P 6P')
         class newstyleclass(object):
             pass
         check(newstyleclass, s)