Expand director_nested_class test to test more than one level of nesting
This commit is contained in:
parent
bca042a7dd
commit
92d3146a06
2 changed files with 20 additions and 0 deletions
|
|
@ -2,15 +2,24 @@
|
||||||
|
|
||||||
|
|
||||||
%feature("director") DirectorOuter::DirectorInner;
|
%feature("director") DirectorOuter::DirectorInner;
|
||||||
|
%feature("director") DirectorOuter::DirectorInner::DirectorInnerInner;
|
||||||
|
|
||||||
%inline %{
|
%inline %{
|
||||||
struct DirectorOuter {
|
struct DirectorOuter {
|
||||||
struct DirectorInner {
|
struct DirectorInner {
|
||||||
virtual ~DirectorInner() {}
|
virtual ~DirectorInner() {}
|
||||||
virtual int vmethod(int input) const = 0;
|
virtual int vmethod(int input) const = 0;
|
||||||
|
struct DirectorInnerInner {
|
||||||
|
DirectorInnerInner(DirectorInner *din = 0) {}
|
||||||
|
virtual ~DirectorInnerInner() {}
|
||||||
|
virtual int innervmethod(int input) const = 0;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
static int callMethod(const DirectorInner &di, int value) {
|
static int callMethod(const DirectorInner &di, int value) {
|
||||||
return di.vmethod(value);
|
return di.vmethod(value);
|
||||||
}
|
}
|
||||||
|
static int callInnerInnerMethod(const DirectorInner::DirectorInnerInner &di, int value) {
|
||||||
|
return di.innervmethod(value);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
%}
|
%}
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,12 @@ public class director_nested_class_runme {
|
||||||
if (DirectorOuter.callMethod(d, 999) != 9990) {
|
if (DirectorOuter.callMethod(d, 999) != 9990) {
|
||||||
throw new RuntimeException("callMethod(999) failed");
|
throw new RuntimeException("callMethod(999) failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
director_nested_class_DerivedInnerInner dinner = new director_nested_class_DerivedInnerInner();
|
||||||
|
|
||||||
|
if (DirectorOuter.callInnerInnerMethod(dinner, 999) != 999000) {
|
||||||
|
throw new RuntimeException("callMethod(999) failed");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -28,3 +34,8 @@ class director_nested_class_Derived extends DirectorOuter.DirectorInner {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class director_nested_class_DerivedInnerInner extends DirectorOuter.DirectorInner.DirectorInnerInner {
|
||||||
|
public int innervmethod(int input) {
|
||||||
|
return input * 1000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue