more %rename/%ignore tests
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6706 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
e893bb526f
commit
0b150a96bb
3 changed files with 13 additions and 0 deletions
|
|
@ -55,6 +55,9 @@ public class runme
|
||||||
Foo foo = new Foo();
|
Foo foo = new Foo();
|
||||||
foo.newname();
|
foo.newname();
|
||||||
foo.newname(10);
|
foo.newname(10);
|
||||||
|
foo.renamed3arg(10, 10.0);
|
||||||
|
foo.renamed2arg(10);
|
||||||
|
foo.renamed1arg();
|
||||||
|
|
||||||
// exception specifications
|
// exception specifications
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
|
|
@ -76,6 +76,10 @@
|
||||||
%rename(bar2) Foo::bar;
|
%rename(bar2) Foo::bar;
|
||||||
%rename(newname) Foo::oldname(int x = 1234);
|
%rename(newname) Foo::oldname(int x = 1234);
|
||||||
%ignore Foo::Foo(int x, int y = 0, int z = 0);
|
%ignore Foo::Foo(int x, int y = 0, int z = 0);
|
||||||
|
%ignore Foo::meth(int x, int y = 0, int z = 0);
|
||||||
|
%rename(renamed3arg) Foo::renameme(int x, double d) const;
|
||||||
|
%rename(renamed2arg) Foo::renameme(int x) const;
|
||||||
|
%rename(renamed1arg) Foo::renameme() const;
|
||||||
|
|
||||||
%inline %{
|
%inline %{
|
||||||
|
|
||||||
|
|
@ -88,6 +92,8 @@
|
||||||
Foo(){}
|
Foo(){}
|
||||||
|
|
||||||
Foo(int x, int y = 0, int z = 0){}
|
Foo(int x, int y = 0, int z = 0){}
|
||||||
|
|
||||||
|
void meth(int x, int y = 0, int z = 0){}
|
||||||
|
|
||||||
// Use a renamed member as a default argument. SWIG has to resolve
|
// Use a renamed member as a default argument. SWIG has to resolve
|
||||||
// bar to Foo::bar and not Foo::spam. SWIG-1.3.11 got this wrong.
|
// bar to Foo::bar and not Foo::spam. SWIG-1.3.11 got this wrong.
|
||||||
|
|
@ -99,6 +105,7 @@
|
||||||
|
|
||||||
// test the method itself being renamed
|
// test the method itself being renamed
|
||||||
void oldname(int x = 1234) {}
|
void oldname(int x = 1234) {}
|
||||||
|
void renameme(int x = 1234, double d=123.4) const {}
|
||||||
};
|
};
|
||||||
int Foo::bar = 1;
|
int Foo::bar = 1;
|
||||||
int Foo::spam = 2;
|
int Foo::spam = 2;
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,9 @@ if (default_args::reftest2() != "hello") {
|
||||||
$foo = new default_args::Foo();
|
$foo = new default_args::Foo();
|
||||||
$foo->newname();
|
$foo->newname();
|
||||||
$foo->newname(10);
|
$foo->newname(10);
|
||||||
|
$foo->renamed3arg(10, 10.0);
|
||||||
|
$foo->renamed2arg(10);
|
||||||
|
$foo->renamed1arg();
|
||||||
|
|
||||||
# exception specifications
|
# exception specifications
|
||||||
eval { default_args::exceptionspec() };
|
eval { default_args::exceptionspec() };
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue