Merge branch 'wkalinin-csymbols-2' - %extend and nested structs
* wkalinin-csymbols-2: Add runtime test for %extend and nested union test fixed %extend symbols for nested structs get into a wrong C symbol table
This commit is contained in:
commit
81d023ac05
3 changed files with 22 additions and 6 deletions
|
|
@ -34,5 +34,12 @@ public class nested_extend_c_runme {
|
|||
if (low.low_extend() != 99)
|
||||
throw new RuntimeException("test failed");
|
||||
}
|
||||
{
|
||||
FOO_bar foobar = new FOO_bar();
|
||||
foobar.setD(1234);
|
||||
if (foobar.getD() != 1234)
|
||||
throw new RuntimeException("test failed");
|
||||
foobar.bar_extend();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
char hi_extend() {
|
||||
return $self->c;
|
||||
}
|
||||
static const long swig_size = sizeof(union hiA);
|
||||
}
|
||||
%extend lowA {
|
||||
lowA() {
|
||||
|
|
@ -21,6 +22,7 @@
|
|||
int low_extend() {
|
||||
return $self->num;
|
||||
}
|
||||
static const long swig_size = sizeof(struct lowA);
|
||||
}
|
||||
|
||||
%extend hiB {
|
||||
|
|
@ -32,6 +34,7 @@
|
|||
char hi_extend() {
|
||||
return $self->c;
|
||||
}
|
||||
static const long swig_size = sizeof(union hiB);
|
||||
}
|
||||
%extend lowB {
|
||||
lowB() {
|
||||
|
|
@ -43,6 +46,7 @@
|
|||
int low_extend() {
|
||||
return $self->num;
|
||||
}
|
||||
static const long swig_size = sizeof(struct lowB);
|
||||
}
|
||||
|
||||
%extend FOO_bar {
|
||||
|
|
@ -50,6 +54,9 @@
|
|||
$self->d = 1;
|
||||
}
|
||||
};
|
||||
%extend NestedA {
|
||||
static const long swig_size = sizeof(struct NestedA);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue