director base method call tests to check recursive director method problem has gone away

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9277 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2006-09-13 20:58:09 +00:00
commit 060dd7f6bd
2 changed files with 203 additions and 0 deletions

View file

@ -75,6 +75,35 @@ public class runme
check(person, "TargetLangOrphanChild");
person.Dispose();
}
// Duals - id() makes an upcall to the base id()
{
Person person = new TargetLangDualPerson();
check(person, "TargetLangDualPerson + Person");
person.Dispose();
}
{
Person person = new TargetLangDualChild();
check(person, "TargetLangDualChild + Child");
person.Dispose();
}
{
Person person = new TargetLangDualGrandChild();
check(person, "TargetLangDualGrandChild + GrandChild");
person.Dispose();
}
// Mix Orphans and Duals
{
Person person = new TargetLangDualOrphanPerson();
check(person, "TargetLangDualOrphanPerson + Person");
person.Dispose();
}
{
Person person = new TargetLangDualOrphanChild();
check(person, "TargetLangDualOrphanChild + Child");
person.Dispose();
}
}
static void check(Person person, String expected) {
@ -209,4 +238,77 @@ class TargetLangOrphanChild : OrphanChild
}
}
// Duals - id() makes an upcall to the base id()
class TargetLangDualPerson : Person
{
public TargetLangDualPerson()
: base()
{
}
public override String id()
{
String identifier = "TargetLangDualPerson + " + base.id();
return identifier;
}
}
class TargetLangDualChild : Child
{
public TargetLangDualChild()
: base()
{
}
public override String id()
{
String identifier = "TargetLangDualChild + " + base.id();
return identifier;
}
}
class TargetLangDualGrandChild : GrandChild
{
public TargetLangDualGrandChild()
: base()
{
}
public override String id()
{
String identifier = "TargetLangDualGrandChild + " + base.id();
return identifier;
}
}
// Mix Orphans and Duals
class TargetLangDualOrphanPerson : OrphanPerson
{
public TargetLangDualOrphanPerson()
: base()
{
}
public override String id()
{
String identifier = "TargetLangDualOrphanPerson + " + base.id();
return identifier;
}
}
class TargetLangDualOrphanChild : OrphanChild
{
public TargetLangDualOrphanChild()
: base()
{
}
public override String id()
{
String identifier = "TargetLangDualOrphanChild + " + base.id();
return identifier;
}
}
}