Add test of null shared pointers emitted from C++

This tests nulls emitted as pointers and values of shared pointers,
created from null, from references, and from default constructors.
This commit is contained in:
Seth R Johnson 2022-02-12 19:39:35 -05:00
commit b08713f09f
2 changed files with 17 additions and 0 deletions

View file

@ -168,6 +168,19 @@ class li_boost_shared_ptr_runme:
except ValueError:
pass
# test null pointers emitted from C++
k = li_boost_shared_ptr.sp_pointer_null()
if (li_boost_shared_ptr.smartpointertest(k) != None):
raise RuntimeError("return was not null")
k = li_boost_shared_ptr.null_sp_pointer()
if (li_boost_shared_ptr.smartpointertest(k) != None):
raise RuntimeError("return was not null")
k = li_boost_shared_ptr.sp_value_null()
if (li_boost_shared_ptr.smartpointertest(k) != None):
raise RuntimeError("return was not null")
# $owner
k = li_boost_shared_ptr.pointerownertest()
val = k.getValue()