[pypy-svn] r79016 - pypy/branch/rlist-jit/pypy/module/cpyext/test

arigo at codespeak.net arigo at codespeak.net
Thu Nov 11 18:38:46 CET 2010


Author: arigo
Date: Thu Nov 11 18:38:44 2010
New Revision: 79016

Modified:
   pypy/branch/rlist-jit/pypy/module/cpyext/test/test_cpyext.py
Log:
Fix test.


Modified: pypy/branch/rlist-jit/pypy/module/cpyext/test/test_cpyext.py
==============================================================================
--- pypy/branch/rlist-jit/pypy/module/cpyext/test/test_cpyext.py	(original)
+++ pypy/branch/rlist-jit/pypy/module/cpyext/test/test_cpyext.py	Thu Nov 11 18:38:44 2010
@@ -534,16 +534,17 @@
             PyObject *true = Py_True;
             PyObject *tup = NULL;
             int refcnt = true->ob_refcnt;
-            int refcnt_after;
+            int refcnt_middle, refcnt_after;
 
             tup = PyTuple_New(1);
             Py_INCREF(true);
             if (PyTuple_SetItem(tup, 0, true) < 0)
                 return NULL;
-            refcnt_after = true->ob_refcnt;
+            refcnt_middle = true->ob_refcnt;
             Py_DECREF(tup);
-            fprintf(stderr, "REFCNT2 %i %i\\n", refcnt, refcnt_after);
-            return PyBool_FromLong(refcnt_after == refcnt);
+            refcnt_after = true->ob_refcnt;
+            fprintf(stderr, "REFCNT2 %i %i %i\\n", refcnt, refcnt_middle, refcnt_after);
+            return PyBool_FromLong(refcnt_after == refcnt && refcnt_middle == refcnt+1);
         }
 
         static PyMethodDef methods[] = {



More information about the Pypy-commit mailing list