From af702c9658c6711c21e2136cec69c11470233fe0 Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Fri, 23 Oct 2009 16:41:24 -0200 Subject: [PATCH] additional test for type casts (ticket #417) --HG-- extra : rebase_source : 3512ea980463bae13f30b0d8bd395cabe253e65c --- tests/run/typetest_T417.pyx | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/run/typetest_T417.pyx b/tests/run/typetest_T417.pyx index fd844ed7..09b1c0bd 100644 --- a/tests/run/typetest_T417.pyx +++ b/tests/run/typetest_T417.pyx @@ -53,3 +53,29 @@ def foo3(arg): TypeError: Cannot convert typetest_T417.Bar to typetest_T417.Foo """ cdef val = arg + + +cdef int count = 0 + +cdef object getFoo(): + global count + count += 1 + return Foo() + +def test_getFoo(): + """ + >>> test_getFoo() + 1 + """ + cdef int old_count = count + cdef Foo x = getFoo() + return count - old_count + +def test_getFooCast(): + """ + >>> test_getFooCast() + 1 + """ + cdef int old_count = count + cdef Foo x = getFoo() + return count - old_count -- 2.26.2