[pypy-svn] r24928 - pypy/dist/pypy/translator/c/test

tismer at codespeak.net tismer at codespeak.net
Fri Mar 24 04:47:12 CET 2006


Author: tismer
Date: Fri Mar 24 04:47:00 2006
New Revision: 24928

Modified:
   pypy/dist/pypy/translator/c/test/test_genc.py
Log:
modified the test to still complain about refcounts but without crashing the machine

Modified: pypy/dist/pypy/translator/c/test/test_genc.py
==============================================================================
--- pypy/dist/pypy/translator/c/test/test_genc.py	(original)
+++ pypy/dist/pypy/translator/c/test/test_genc.py	Fri Mar 24 04:47:00 2006
@@ -389,11 +389,13 @@
 
 # this test crashes after 30 runs on my XP machine
 def test_refcount_pyobj():
-    def prob_with_pyobj(a=int, b=int):
-        return 2, 3, long(42)
+    def prob_with_pyobj(a, b):
+        return 2, 3, b
 
-    f = compile(prob_with_pyobj, [int, int])
-    ret = f(2, 3)
-    for i in xrange(1000):
-        print i
-        f(2, 3)
+    f = compile(prob_with_pyobj, [int, object])
+    from sys import getrefcount as g
+    obj = None
+    before = g(obj)
+    f(2, obj)
+    after = g(obj)
+    assert before == after
\ No newline at end of file



More information about the Pypy-commit mailing list