More comprehensive test
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9228 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
8a2a92d720
commit
9a6a77c6c0
2 changed files with 192 additions and 0 deletions
|
|
@ -36,6 +36,45 @@ public class runme
|
|||
check(person, "TargetLangGrandChild");
|
||||
person.Dispose();
|
||||
}
|
||||
|
||||
// Semis - don't override id() in target language
|
||||
{
|
||||
Person person = new TargetLangSemiPerson();
|
||||
check(person, "Person");
|
||||
person.Dispose();
|
||||
}
|
||||
{
|
||||
Person person = new TargetLangSemiChild();
|
||||
check(person, "Child");
|
||||
person.Dispose();
|
||||
}
|
||||
{
|
||||
Person person = new TargetLangSemiGrandChild();
|
||||
check(person, "GrandChild");
|
||||
person.Dispose();
|
||||
}
|
||||
|
||||
// Orphans - don't override id() in C++
|
||||
{
|
||||
Person person = new OrphanPerson();
|
||||
check(person, "Person");
|
||||
person.Dispose();
|
||||
}
|
||||
{
|
||||
Person person = new OrphanChild();
|
||||
check(person, "Child");
|
||||
person.Dispose();
|
||||
}
|
||||
{
|
||||
Person person = new TargetLangOrphanPerson();
|
||||
check(person, "TargetLangOrphanPerson");
|
||||
person.Dispose();
|
||||
}
|
||||
{
|
||||
Person person = new TargetLangOrphanChild();
|
||||
check(person, "TargetLangOrphanChild");
|
||||
person.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
static void check(Person person, String expected) {
|
||||
|
|
@ -113,4 +152,61 @@ public class TargetLangGrandChild : GrandChild
|
|||
}
|
||||
}
|
||||
|
||||
// Semis - don't override id() in target language
|
||||
public class TargetLangSemiPerson : Person
|
||||
{
|
||||
public TargetLangSemiPerson()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
// No id() override
|
||||
}
|
||||
|
||||
public class TargetLangSemiChild : Child
|
||||
{
|
||||
public TargetLangSemiChild()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
// No id() override
|
||||
}
|
||||
|
||||
public class TargetLangSemiGrandChild : GrandChild
|
||||
{
|
||||
public TargetLangSemiGrandChild()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
// No id() override
|
||||
}
|
||||
|
||||
// Orphans - don't override id() in C++
|
||||
class TargetLangOrphanPerson : OrphanPerson
|
||||
{
|
||||
public TargetLangOrphanPerson()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
|
||||
public override String id()
|
||||
{
|
||||
String identifier = "TargetLangOrphanPerson";
|
||||
return identifier;
|
||||
}
|
||||
}
|
||||
|
||||
class TargetLangOrphanChild : OrphanChild
|
||||
{
|
||||
public TargetLangOrphanChild()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
|
||||
public override String id()
|
||||
{
|
||||
String identifier = "TargetLangOrphanChild";
|
||||
return identifier;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,6 +42,45 @@ public class director_classic_runme {
|
|||
check(person, "TargetLangGrandChild");
|
||||
person.delete();
|
||||
}
|
||||
|
||||
// Semis - don't override id() in target language
|
||||
{
|
||||
Person person = new TargetLangSemiPerson();
|
||||
check(person, "Person");
|
||||
person.delete();
|
||||
}
|
||||
{
|
||||
Person person = new TargetLangSemiChild();
|
||||
check(person, "Child");
|
||||
person.delete();
|
||||
}
|
||||
{
|
||||
Person person = new TargetLangSemiGrandChild();
|
||||
check(person, "GrandChild");
|
||||
person.delete();
|
||||
}
|
||||
|
||||
// Orphans - don't override id() in C++
|
||||
{
|
||||
Person person = new OrphanPerson();
|
||||
check(person, "Person");
|
||||
person.delete();
|
||||
}
|
||||
{
|
||||
Person person = new OrphanChild();
|
||||
check(person, "Child");
|
||||
person.delete();
|
||||
}
|
||||
{
|
||||
Person person = new TargetLangOrphanPerson();
|
||||
check(person, "TargetLangOrphanPerson");
|
||||
person.delete();
|
||||
}
|
||||
{
|
||||
Person person = new TargetLangOrphanChild();
|
||||
check(person, "TargetLangOrphanChild");
|
||||
person.delete();
|
||||
}
|
||||
}
|
||||
|
||||
static void check(Person person, String expected) {
|
||||
|
|
@ -119,3 +158,60 @@ class TargetLangGrandChild extends GrandChild
|
|||
}
|
||||
}
|
||||
|
||||
// Semis - don't override id() in target language
|
||||
class TargetLangSemiPerson extends Person
|
||||
{
|
||||
public TargetLangSemiPerson()
|
||||
{
|
||||
super();
|
||||
}
|
||||
// No id() override
|
||||
}
|
||||
|
||||
class TargetLangSemiChild extends Child
|
||||
{
|
||||
public TargetLangSemiChild()
|
||||
{
|
||||
super();
|
||||
}
|
||||
// No id() override
|
||||
}
|
||||
|
||||
class TargetLangSemiGrandChild extends GrandChild
|
||||
{
|
||||
public TargetLangSemiGrandChild()
|
||||
{
|
||||
super();
|
||||
}
|
||||
// No id() override
|
||||
}
|
||||
|
||||
// Orphans - don't override id() in C++
|
||||
class TargetLangOrphanPerson extends OrphanPerson
|
||||
{
|
||||
public TargetLangOrphanPerson()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public String id()
|
||||
{
|
||||
String identifier = "TargetLangOrphanPerson";
|
||||
return identifier;
|
||||
}
|
||||
}
|
||||
|
||||
class TargetLangOrphanChild extends OrphanChild
|
||||
{
|
||||
public TargetLangOrphanChild()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public String id()
|
||||
{
|
||||
String identifier = "TargetLangOrphanChild";
|
||||
return identifier;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue