mirror of https://github.com/swig/swig
Add more runtime typedef_classforward_same_name runtime testing
This commit is contained in:
parent
3617e22fda
commit
ce6960de92
|
@ -15,8 +15,12 @@ public class typedef_classforward_same_name_runme {
|
|||
public static void main(String argv[]) {
|
||||
Foo foo = new Foo();
|
||||
foo.setX(5);
|
||||
if (typedef_classforward_same_name.extract(foo) == 5) {
|
||||
// All good!
|
||||
}
|
||||
if (typedef_classforward_same_name.extractFoo(foo) != 5)
|
||||
throw new RuntimeException("unexpected value");
|
||||
|
||||
Boo boo = new Boo();
|
||||
boo.setX(5);
|
||||
if (typedef_classforward_same_name.extractBoo(boo) != 5)
|
||||
throw new RuntimeException("unexpected value");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
from typedef_classforward_same_name import *
|
||||
|
||||
foo = Foo()
|
||||
foo.x = 5
|
||||
if extractFoo(foo) != 5:
|
||||
raise RuntimeError("unexpected value")
|
||||
|
||||
boo = Boo()
|
||||
boo.x = 5
|
||||
if extractBoo(boo) != 5:
|
||||
raise RuntimeError("unexpected value")
|
|
@ -5,5 +5,11 @@ typedef struct Foo Foo;
|
|||
struct Foo {
|
||||
int x;
|
||||
};
|
||||
int extract(Foo* foo) { return foo->x; }
|
||||
%}
|
||||
int extractFoo(Foo* foo) { return foo->x; }
|
||||
|
||||
struct Boo {
|
||||
int x;
|
||||
};
|
||||
typedef struct Boo Boo;
|
||||
int extractBoo(Boo* boo) { return boo->x; }
|
||||
%}
|
||||
|
|
Loading…
Reference in New Issue