Added test case for a forward declaration in a typedef with the same
name
This commit is contained in:
parent
717b7866d4
commit
6b2bcfed0b
3 changed files with 33 additions and 0 deletions
|
|
@ -490,6 +490,7 @@ CPP_TEST_CASES += \
|
||||||
throw_exception \
|
throw_exception \
|
||||||
typedef_array_member \
|
typedef_array_member \
|
||||||
typedef_class \
|
typedef_class \
|
||||||
|
typedef_classforward_same_name \
|
||||||
typedef_funcptr \
|
typedef_funcptr \
|
||||||
typedef_inherit \
|
typedef_inherit \
|
||||||
typedef_mptr \
|
typedef_mptr \
|
||||||
|
|
@ -676,6 +677,7 @@ C_TEST_CASES += \
|
||||||
string_simple \
|
string_simple \
|
||||||
struct_rename \
|
struct_rename \
|
||||||
struct_initialization \
|
struct_initialization \
|
||||||
|
typedef_classforward_same_name \
|
||||||
typedef_struct \
|
typedef_struct \
|
||||||
typemap_subst \
|
typemap_subst \
|
||||||
union_parameter \
|
union_parameter \
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
|
||||||
|
import typedef_classforward_same_name.*;
|
||||||
|
|
||||||
|
public class typedef_classforward_same_name_runme {
|
||||||
|
|
||||||
|
static {
|
||||||
|
try {
|
||||||
|
System.loadLibrary("typedef_classforward_same_name");
|
||||||
|
} catch (UnsatisfiedLinkError e) {
|
||||||
|
System.err.println("Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + e);
|
||||||
|
System.exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String argv[]) {
|
||||||
|
Foo foo = new Foo();
|
||||||
|
foo.setX(5);
|
||||||
|
if (typedef_classforward_same_name.extract(foo) == 5) {
|
||||||
|
// All good!
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
9
Examples/test-suite/typedef_classforward_same_name.i
Normal file
9
Examples/test-suite/typedef_classforward_same_name.i
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
%module typedef_classforward_same_name
|
||||||
|
|
||||||
|
%inline %{
|
||||||
|
typedef struct Foo Foo;
|
||||||
|
struct Foo {
|
||||||
|
int x;
|
||||||
|
};
|
||||||
|
int extract(Foo* foo) { return foo->x; }
|
||||||
|
%}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue