test for default argument in director virtual methods and constructors
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6353 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
963a72613b
commit
37863d349b
2 changed files with 31 additions and 0 deletions
|
|
@ -117,6 +117,7 @@ CPP_TEST_CASES += \
|
|||
director_abstract \
|
||||
director_basic \
|
||||
director_detect \
|
||||
director_default \
|
||||
director_exception \
|
||||
director_frob \
|
||||
director_finalizer \
|
||||
|
|
|
|||
30
Examples/test-suite/director_default.i
Normal file
30
Examples/test-suite/director_default.i
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
%module(directors="1") director_default
|
||||
%{
|
||||
#include <string>
|
||||
|
||||
class Foo {
|
||||
public:
|
||||
Foo(int i = -1) {}
|
||||
virtual ~Foo() {}
|
||||
virtual std::string Msg(std::string msg = "default") { return "Foo-" + msg; }
|
||||
|
||||
std::string GetMsg() { return Msg(); }
|
||||
std::string GetMsg(std::string msg) { return Msg(msg); }
|
||||
};
|
||||
|
||||
%}
|
||||
|
||||
%include "std_string.i"
|
||||
|
||||
%feature("director") Foo;
|
||||
|
||||
class Foo {
|
||||
public:
|
||||
Foo(int i = -1) {}
|
||||
virtual ~Foo() {}
|
||||
virtual std::string Msg(std::string msg = "default") { return msg; }
|
||||
|
||||
std::string GetMsg() { return Msg(); }
|
||||
std::string GetMsg(std::string msg) { return Msg(msg); }
|
||||
};
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue