more tests for exception
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5945 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
3f8ed3e650
commit
7598abd1fe
2 changed files with 35 additions and 0 deletions
|
|
@ -70,3 +70,30 @@ public:
|
|||
|
||||
Foo *launder(Foo *f);
|
||||
|
||||
%{
|
||||
struct Unknown1
|
||||
{
|
||||
};
|
||||
|
||||
struct Unknown2
|
||||
{
|
||||
};
|
||||
%}
|
||||
%inline %{
|
||||
struct Exception1
|
||||
{
|
||||
};
|
||||
|
||||
struct Exception2
|
||||
{
|
||||
};
|
||||
|
||||
class Bar
|
||||
{
|
||||
public:
|
||||
virtual ~Bar(){}
|
||||
virtual std::string ping() throw (Exception1, Exception2&) { return "Bar::ping()"; }
|
||||
virtual std::string pong() throw (Unknown1, int, Unknown2&) { return "Bar::pong();" + ping(); }
|
||||
};
|
||||
|
||||
%}
|
||||
|
|
|
|||
|
|
@ -40,4 +40,12 @@ if not ok:
|
|||
raise RuntimeError
|
||||
|
||||
|
||||
try:
|
||||
raise Exception2()
|
||||
except Exception2:
|
||||
pass
|
||||
|
||||
try:
|
||||
raise Exception1()
|
||||
except Exception1:
|
||||
pass
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue