Commits

Mark Shannon committed 5cf089b Draft

Update test_sys to reflect new size of dict-keys, function and type for guards

  • Participants
  • Parent commits 983fdf7

Comments (0)

Files changed (1)

File Lib/test/test_sys.py

         # method-wrapper (descriptor object)
         check({}.__iter__, size(h + '2P'))
         # dict
-        check({}, size(h + '3P' + '4P' + 8*'P2P'))
+        check({}, size(h + '3P' + '5P' + 8*'P2P'))
         longdict = {1:1, 2:2, 3:3, 4:4, 5:5, 6:6, 7:7, 8:8}
-        check(longdict, size(h + '3P' + '4P') + 16*size('P2P'))
+        check(longdict, size(h + '3P' + '5P') + 16*size('P2P'))
         # dictionary-keyiterator
         check({}.keys(), size(h + 'P'))
         # dictionary-valueiterator
         x = inspect.currentframe()
         ncells = len(x.f_code.co_cellvars)
         nfrees = len(x.f_code.co_freevars)
+        HOTPY_STACK_OVERHEAD = 5
         extras = x.f_code.co_stacksize + x.f_code.co_nlocals +\
-                  ncells + nfrees - 1
+                  ncells + nfrees - 1 + HOTPY_STACK_OVERHEAD
         check(x, size(vh + '12P3i' + CO_MAXBLOCKS*'3i' + 'P' + extras*'P'))
         # function
         def func(): pass
-        check(func, size(h + '12P'))
+        check(func, size(h + '13P'))
         class c():
             @staticmethod
             def foo():
         s = size(vh + 'P2P15Pl4PP9PP11PI')
         check(int, s)
         # (PyTypeObject + PyNumberMethods + PyMappingMethods +
-        #  PySequenceMethods + PyBufferProcs + 4P)
-        s = size(vh + 'P2P15Pl4PP9PP11PI') + size('34P 3P 10P 2P 4P')
+        #  PySequenceMethods + PyBufferProcs + 5P)
+        s = size(vh + 'P2P15Pl4PP9PP11PI') + size('34P 3P 10P 2P 5P')
         # Separate block for PyDictKeysObject with 4 entries
-        s += size("PPPP") + 4*size("PPP")
+        s += size("PPPPP") + 4*size("PPP")
         # class
         class newstyleclass(object): pass
         check(newstyleclass, s)