Commit fe08775d authored by Robert Bradshaw's avatar Robert Bradshaw Committed by Stefan Behnel

Failing test for calling derived class destructor in deallocation.

parent 8276413c
...@@ -129,6 +129,9 @@ def test_stack_allocation(int w, int h): ...@@ -129,6 +129,9 @@ def test_stack_allocation(int w, int h):
cdef class EmptyHolder: cdef class EmptyHolder:
cdef Empty empty cdef Empty empty
cdef class AnotherEmptyHolder(EmptyHolder):
cdef Empty another_empty
def test_class_member(): def test_class_member():
""" """
>>> test_class_member() >>> test_class_member()
...@@ -145,6 +148,19 @@ def test_class_member(): ...@@ -145,6 +148,19 @@ def test_class_member():
assert destructor_count - start_destructor_count == 2, \ assert destructor_count - start_destructor_count == 2, \
destructor_count - start_destructor_count destructor_count - start_destructor_count
def test_derived_class_member():
"""
>>> test_derived_class_member()
"""
start_constructor_count = constructor_count
start_destructor_count = destructor_count
e = AnotherEmptyHolder()
assert constructor_count - start_constructor_count == 2, \
constructor_count - start_constructor_count
del e
assert destructor_count - start_destructor_count == 2, \
destructor_count - start_destructor_count
cdef class TemplateClassMember: cdef class TemplateClassMember:
cdef vector[int] x cdef vector[int] x
cdef vector[vector[Empty]] vec cdef vector[vector[Empty]] vec
......
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