mirror of
https://github.com/python/cpython.git
synced 2025-07-29 06:05:00 +00:00
Fixed test failure on Win64 machines.
This commit is contained in:
parent
fb7a50fbb9
commit
2ee623b710
1 changed files with 5 additions and 8 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue