Commit 1bb76726 authored by Xavier Thompson's avatar Xavier Thompson

Add unit test for cypclass refcounting after exceptions

parent f0fb0efa
# mode: run
# tag: cpp, cpp11
# cython: experimental_cpp_class_def=True, language_level=2
cdef cypclass Refcounted nolock:
pass
cdef int raises(Refcounted r) except 0:
raise Exception
def test_exception_refcount_cleanup():
"""
>>> test_exception_refcount_cleanup()
2
"""
r = Refcounted()
for i in range(50):
try:
raises(r)
except:
pass
return Cy_GETREF(r)
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