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:
Marcelo Matus 2004-05-29 23:24:53 +00:00
commit 7598abd1fe
2 changed files with 35 additions and 0 deletions

View file

@ -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(); }
};
%}

View file

@ -40,4 +40,12 @@ if not ok:
raise RuntimeError
try:
raise Exception2()
except Exception2:
pass
try:
raise Exception1()
except Exception1:
pass