Add test case for using nspace without -package. TODO: Fix Makefile.in to actually not use -package when invoking swig.
This commit is contained in:
parent
30b1eafd96
commit
988952af65
2 changed files with 35 additions and 0 deletions
34
Examples/test-suite/java_nspacewithoutpackage.i
Normal file
34
Examples/test-suite/java_nspacewithoutpackage.i
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
%module java_nspacewithoutpackage
|
||||
|
||||
%pragma(java) jniclasspackage="PragmaDefinedPackage"
|
||||
|
||||
SWIG_JAVABODY_PROXY(public, public, SWIGTYPE)
|
||||
SWIG_JAVABODY_TYPEWRAPPER(public, public, public, SWIGTYPE)
|
||||
|
||||
%include <std_string.i>
|
||||
|
||||
%nspace TopLevel::Foo;
|
||||
%nspace TopLevel::Bar;
|
||||
|
||||
%{
|
||||
#include <string>
|
||||
%}
|
||||
|
||||
%inline %{
|
||||
|
||||
namespace TopLevel
|
||||
{
|
||||
class Foo {
|
||||
public:
|
||||
virtual ~Foo() {}
|
||||
virtual std::string ping() { return "TopLevel::Foo::ping()"; }
|
||||
};
|
||||
|
||||
class Bar {
|
||||
public:
|
||||
virtual ~Bar() {}
|
||||
virtual std::string pong() { return "TopLevel::Bar::pong()"; }
|
||||
};
|
||||
}
|
||||
|
||||
%}
|
||||
Loading…
Add table
Add a link
Reference in a new issue