Commit 54261947 authored by Stefan Behnel's avatar Stefan Behnel

added test for stack allocated C++ object

parent 946cfc01
...@@ -85,6 +85,22 @@ def test_value_call(int w): ...@@ -85,6 +85,22 @@ def test_value_call(int w):
finally: finally:
del sqr del sqr
def get_destructor_count():
return destructor_count
def test_stack_allocation(int w, int h):
"""
>>> d = test_stack_allocation(10, 12)
125
>>> get_destructor_count() - d
1
"""
cdef Rectangle rect
rect.width = w
rect.height = h
print rect.method(<int>5)
return destructor_count
cdef class EmptyHolder: cdef class EmptyHolder:
cdef Empty empty cdef Empty empty
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment