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