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
|
|
@ -1,6 +1,6 @@
|
|||
use strict;
|
||||
use warnings;
|
||||
use Test::More tests => 28;
|
||||
use Test::More tests => 30;
|
||||
BEGIN { use_ok('li_std_auto_ptr') }
|
||||
require_ok('li_std_auto_ptr');
|
||||
|
||||
|
|
@ -73,6 +73,11 @@ sub checkCount {
|
|||
checkCount(0);
|
||||
}
|
||||
|
||||
li_std_auto_ptr::takeKlassAutoPtr(undef);
|
||||
li_std_auto_ptr::takeKlassAutoPtr(li_std_auto_ptr::make_null());
|
||||
checkCount(0);
|
||||
|
||||
|
||||
# auto_ptr as output
|
||||
my $k1 = li_std_auto_ptr::makeKlassAutoPtr("first");
|
||||
my $k2 = li_std_auto_ptr::makeKlassAutoPtr("second");
|
||||
|
|
@ -85,3 +90,5 @@ is($k2->getLabel, "second", "proper label");
|
|||
|
||||
undef $k2;
|
||||
checkCount(0);
|
||||
|
||||
is(li_std_auto_ptr::makeNullAutoPtr(), undef);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue