Test/fixes to handle NULL pointer for unique_ptr/auto_ptr
Also add missing unique_ptr tests for Lua and Racket.
This commit is contained in:
parent
ca9eebcb8d
commit
7934561874
32 changed files with 434 additions and 6 deletions
|
|
@ -93,6 +93,13 @@ endif
|
|||
clear kini; # Should not fail, even though already deleted
|
||||
checkCount(0);
|
||||
|
||||
null = []; # NULL pointer
|
||||
null_ptr = make_null();
|
||||
takeKlassAutoPtr([]);
|
||||
takeKlassAutoPtr(null);
|
||||
takeKlassAutoPtr(null_ptr);
|
||||
checkCount(0);
|
||||
|
||||
|
||||
# auto_ptr as output
|
||||
k1 = makeKlassAutoPtr("first");
|
||||
|
|
@ -112,3 +119,8 @@ endif
|
|||
|
||||
clear k2;
|
||||
checkCount(0);
|
||||
|
||||
null_smart_prt = makeNullAutoPtr();
|
||||
assert(ismatrix(null_smart_prt))
|
||||
assert(size(null_smart_prt) == size([]))
|
||||
assert(isequal([], null_smart_prt))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue