Skip to content

Commit

Permalink
Add test foor shared_ptr assignment to base classes
Browse files Browse the repository at this point in the history
  • Loading branch information
fuglede committed May 21, 2021
1 parent dd9bae4 commit 4f62d3c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/run/cpp_smart_ptr.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@ cdef cppclass C(B):

cdef shared_ptr[A] holding_subclass = shared_ptr[A](new C())


def test_assignment_to_base_class():
"""
>>> test_assignment_to_base_class()
"""
cdef shared_ptr[C] derived = shared_ptr[C](new C())
cdef shared_ptr[A] base = derived


def test_dynamic_pointer_cast():
"""
>>> test_dynamic_pointer_cast()
Expand Down

0 comments on commit 4f62d3c

Please sign in to comment.