From d61c005fd188cd8e7a6f5c2542a627795b41cc65 Mon Sep 17 00:00:00 2001 From: Pauli Virtanen Date: Sun, 17 Mar 2013 20:12:19 +0200 Subject: [PATCH] Add test for the fused type refcounting issue --- tests/run/fused_types.pyx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/run/fused_types.pyx b/tests/run/fused_types.pyx index c452157..1a2e828 100644 --- a/tests/run/fused_types.pyx +++ b/tests/run/fused_types.pyx @@ -222,6 +222,18 @@ def test_normal_class(): """ NormalClass().method[pure_cython.short](10) +def test_normal_class_refcount(): + """ + >>> test_normal_class_refcount() + short 10 + 0 + """ + import sys + x = NormalClass() + c = sys.getrefcount(x) + x.method[pure_cython.short](10) + print sys.getrefcount(x) - c + def test_fused_declarations(cython.integral i, cython.floating f): """ >>> test_fused_declarations[pure_cython.short, pure_cython.float](5, 6.6) -- 2.7.4