[pypy-svn] r78004 - pypy/branch/leak-finder/pypy/module/cpyext/test

arigo at codespeak.net arigo at codespeak.net
Fri Oct 15 18:59:47 CEST 2010


Author: arigo
Date: Fri Oct 15 18:59:45 2010
New Revision: 78004

Modified:
   pypy/branch/leak-finder/pypy/module/cpyext/test/test_cpyext.py
Log:
Fix this test to depend on the default leakfinder.


Modified: pypy/branch/leak-finder/pypy/module/cpyext/test/test_cpyext.py
==============================================================================
--- pypy/branch/leak-finder/pypy/module/cpyext/test/test_cpyext.py	(original)
+++ pypy/branch/leak-finder/pypy/module/cpyext/test/test_cpyext.py	Fri Oct 15 18:59:45 2010
@@ -16,6 +16,7 @@
 from pypy.module.cpyext.pyobject import Py_DecRef, InvalidPointerException
 from pypy.translator.goal import autopath
 from pypy.tool.identity_dict import identity_dict
+from pypy.tool import leakfinder
 
 @api.cpython_api([], api.PyObject)
 def PyPy_Crash1(space):
@@ -78,7 +79,6 @@
         self.frozen_refcounts[w_obj] = obj.c_ob_refcnt
     #state.print_refcounts()
     self.frozen_ll2callocations = set(ll2ctypes.ALLOCATED.values())
-    lltype.start_tracking_allocations()
 
 class LeakCheckingTest(object):
     def check_and_print_leaks(self):
@@ -126,17 +126,8 @@
         for w_obj in lost_objects_w:
             print >>sys.stderr, "Lost object %r" % (w_obj, )
             leaking = True
-##        for llvalue in set(ll2ctypes.ALLOCATED.values()) - self.frozen_ll2callocations:
-##            if llvalue in lltype.ALLOCATED:
-##                leaking = True
-##                print >>sys.stderr, "Did not deallocate %r (ll2ctypes)" % (llvalue, )
-##                print >>sys.stderr, "\t" + "\n\t".join(llvalue._traceback.splitlines())
-        for llvalue, traceback in lltype.ALLOCATED.items():
-            leaking = True
-            print >>sys.stderr, "Did not deallocate %r (llvalue)" % (llvalue, )
-            print >>sys.stderr, "\t" + "\n\t".join(traceback.splitlines())
-
-        lltype.stop_tracking_allocations(check=False)
+        # the actual low-level leak checking is done by pypy.tool.leakfinder,
+        # enabled automatically by pypy.conftest.
         return leaking
 
 class AppTestCpythonExtensionBase(LeakCheckingTest):



More information about the Pypy-commit mailing list