Correct raw pointer handling test for virtual inheritance
This commit is contained in:
parent
1f2338bf41
commit
63632f80fb
12 changed files with 16 additions and 14 deletions
|
|
@ -15,7 +15,7 @@ end
|
|||
# Test raw pointer handling involving virtual inheritance
|
||||
kini = KlassInheritance("KlassInheritanceInput");
|
||||
checkCount(1);
|
||||
s = takeKlassUniquePtr(kini);
|
||||
s = useKlassRawPtr(kini);
|
||||
if (!strcmp(s, "KlassInheritanceInput"))
|
||||
error("Incorrect string: %s", s);
|
||||
endif
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ end
|
|||
# Test raw pointer handling involving virtual inheritance
|
||||
kini = KlassInheritance("KlassInheritanceInput");
|
||||
checkCount(1);
|
||||
s = takeKlassAutoPtr(kini);
|
||||
s = useKlassRawPtr(kini);
|
||||
if (!strcmp(s, "KlassInheritanceInput"))
|
||||
error("Incorrect string: %s", s);
|
||||
endif
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ sub checkCount {
|
|||
{
|
||||
my $kini = new cpp11_std_unique_ptr::KlassInheritance("KlassInheritanceInput");
|
||||
checkCount(1);
|
||||
my $s = cpp11_std_unique_ptr::takeKlassUniquePtr($kini);
|
||||
my $s = cpp11_std_unique_ptr::useKlassRawPtr($kini);
|
||||
is($s, "KlassInheritanceInput", "Incorrect string: $s");
|
||||
undef $kini;
|
||||
checkCount(0);
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ sub checkCount {
|
|||
{
|
||||
my $kini = new li_std_auto_ptr::KlassInheritance("KlassInheritanceInput");
|
||||
checkCount(1);
|
||||
my $s = li_std_auto_ptr::takeKlassAutoPtr($kini);
|
||||
my $s = li_std_auto_ptr::useKlassRawPtr($kini);
|
||||
is($s, "KlassInheritanceInput", "Incorrect string: $s");
|
||||
undef $kini;
|
||||
checkCount(0);
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ function checkCount($expected_count) {
|
|||
# Test raw pointer handling involving virtual inheritance
|
||||
$kini = new KlassInheritance("KlassInheritanceInput");
|
||||
checkCount(1);
|
||||
$s = takeKlassUniquePtr($kini);
|
||||
$s = useKlassRawPtr($kini);
|
||||
check::equal($s, "KlassInheritanceInput", "Incorrect string: $s");
|
||||
$kini = NULL;
|
||||
checkCount(0);
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ function checkCount($expected_count) {
|
|||
# Test raw pointer handling involving virtual inheritance
|
||||
$kini = new KlassInheritance("KlassInheritanceInput");
|
||||
checkCount(1);
|
||||
$s = takeKlassAutoPtr($kini);
|
||||
$s = useKlassRawPtr($kini);
|
||||
check::equal($s, "KlassInheritanceInput", "Incorrect string: $s");
|
||||
$kini = NULL;
|
||||
checkCount(0);
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ def checkCount(expected_count):
|
|||
# Test raw pointer handling involving virtual inheritance
|
||||
kini = KlassInheritance("KlassInheritanceInput")
|
||||
checkCount(1)
|
||||
s = takeKlassUniquePtr(kini)
|
||||
s = useKlassRawPtr(kini)
|
||||
if s != "KlassInheritanceInput":
|
||||
raise RuntimeError("Incorrect string: " + s)
|
||||
del kini
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ def checkCount(expected_count):
|
|||
# Test raw pointer handling involving virtual inheritance
|
||||
kini = KlassInheritance("KlassInheritanceInput")
|
||||
checkCount(1)
|
||||
s = takeKlassAutoPtr(kini)
|
||||
s = useKlassRawPtr(kini)
|
||||
if s != "KlassInheritanceInput":
|
||||
raise RuntimeError("Incorrect string: " + s)
|
||||
del kini
|
||||
|
|
|
|||
|
|
@ -21,11 +21,12 @@ end
|
|||
# Test raw pointer handling involving virtual inheritance
|
||||
kini = Cpp11_std_unique_ptr::KlassInheritance.new("KlassInheritanceInput")
|
||||
checkCount(1)
|
||||
s = Cpp11_std_unique_ptr.takeKlassUniquePtr(kini)
|
||||
s = Cpp11_std_unique_ptr.useKlassRawPtr(kini)
|
||||
if (s != "KlassInheritanceInput")
|
||||
raise RuntimeError, "Incorrect string: " + s
|
||||
end
|
||||
kini = nil
|
||||
# kini = nil
|
||||
Cpp11_std_unique_ptr.takeKlassUniquePtr(kini) # Ensure object is deleted (can't rely on GC)
|
||||
checkCount(0)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -21,11 +21,12 @@ end
|
|||
# Test raw pointer handling involving virtual inheritance
|
||||
kini = Li_std_auto_ptr::KlassInheritance.new("KlassInheritanceInput")
|
||||
checkCount(1)
|
||||
s = Li_std_auto_ptr.takeKlassAutoPtr(kini)
|
||||
s = Li_std_auto_ptr.useKlassRawPtr(kini)
|
||||
if (s != "KlassInheritanceInput")
|
||||
raise RuntimeError, "Incorrect string: " + s
|
||||
end
|
||||
kini = nil
|
||||
# kini = nil
|
||||
Li_std_auto_ptr.takeKlassAutoPtr(kini) # Ensure object is deleted (can't rely on GC)
|
||||
checkCount(0)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ checkCount 0
|
|||
# Test raw pointer handling involving virtual inheritance
|
||||
KlassInheritance kini "KlassInheritanceInput"
|
||||
checkCount 1
|
||||
set s [takeKlassUniquePtr kini]
|
||||
set s [useKlassRawPtr kini]
|
||||
kini -delete
|
||||
checkCount 0
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ proc checkCount {expected_count} {
|
|||
# Test raw pointer handling involving virtual inheritance
|
||||
KlassInheritance kini "KlassInheritanceInput"
|
||||
checkCount 1
|
||||
set s [takeKlassAutoPtr kini]
|
||||
set s [useKlassRawPtr kini]
|
||||
kini -delete
|
||||
checkCount 0
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue