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
|
|
@ -90,6 +90,11 @@ var checkCount = function(expected_count) {
|
|||
checkCount(0);
|
||||
}
|
||||
|
||||
cpp11_std_unique_ptr.takeKlassUniquePtr(null);
|
||||
cpp11_std_unique_ptr.takeKlassUniquePtr(cpp11_std_unique_ptr.make_null());
|
||||
checkCount(0);
|
||||
|
||||
|
||||
// unique_ptr as output
|
||||
k1 = cpp11_std_unique_ptr.makeKlassUniquePtr("first");
|
||||
if (k1.getLabel() !== "first")
|
||||
|
|
@ -110,3 +115,6 @@ if (k2.getLabel() !== "second")
|
|||
// Above not deleting the C++ object(node v12) - can't reliably control GC
|
||||
cpp11_std_unique_ptr.takeKlassUniquePtr(k2);
|
||||
checkCount(0);
|
||||
|
||||
if (cpp11_std_unique_ptr.makeNullUniquePtr() != null)
|
||||
throw new Error("null failure");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue