[pypy-svn] r74296 - in pypy/trunk/pypy: module/cpyext/test rpython/lltypesystem

afa at codespeak.net afa at codespeak.net
Fri Apr 30 18:41:49 CEST 2010


Author: afa
Date: Fri Apr 30 18:41:48 2010
New Revision: 74296

Modified:
   pypy/trunk/pypy/module/cpyext/test/test_unicodeobject.py
   pypy/trunk/pypy/rpython/lltypesystem/lltype.py
Log:
Fix apparently leaking tests


Modified: pypy/trunk/pypy/module/cpyext/test/test_unicodeobject.py
==============================================================================
--- pypy/trunk/pypy/module/cpyext/test/test_unicodeobject.py	(original)
+++ pypy/trunk/pypy/module/cpyext/test/test_unicodeobject.py	Fri Apr 30 18:41:48 2010
@@ -115,7 +115,6 @@
         rffi.free_charp(b_encoding)
 
     def test_leak(self):
-        py.test.skip("This test seems to leak memory")
         size = 50
         raw_buf, gc_buf = rffi.alloc_buffer(size)
         for i in range(size): raw_buf[i] = 'a'
@@ -133,7 +132,3 @@
         rffi.free_wcharp(wbuf)
         assert space.type(w_str) is space.w_str
         assert space.str_w(w_str) == "abc?"
-
-        # XXX this test seems to leak references, see test_leak above
-        from pypy.module.cpyext.test.test_cpyext import freeze_refcnts
-        freeze_refcnts(self)

Modified: pypy/trunk/pypy/rpython/lltypesystem/lltype.py
==============================================================================
--- pypy/trunk/pypy/rpython/lltypesystem/lltype.py	(original)
+++ pypy/trunk/pypy/rpython/lltypesystem/lltype.py	Fri Apr 30 18:41:48 2010
@@ -1452,7 +1452,8 @@
         first, FIRSTTYPE = TYPE._first_struct()
         for fld, typ in TYPE._flds.items():
             if fld == TYPE._arrayfld:
-                value = _array(typ, n, initialization=initialization, parent=self, parentindex=fld)
+                value = _array(typ, n, initialization=initialization, parent=self, parentindex=fld,
+                               track_allocation=track_allocation)
             else:
                 value = typ._allocate(initialization=initialization, parent=self, parentindex=fld)
             setattr(self, fld, value)



More information about the Pypy-commit mailing list