Implement basic C++ exception test for C backend.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2012-c@13479 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Leif Middelschulte 2012-07-31 21:15:33 +00:00
commit 130ae2cb26
3 changed files with 40 additions and 1 deletions

View file

@ -0,0 +1,25 @@
%module c_backend_cpp_exception
%exception {
try {
$action
} catch(SomeKnownException) {
checkVal = 1;
} catch(...) {
checkVal = 2;
}
}
%inline %{
class SomeKnownException{};
class SomeUnkownException{};
int checkVal = 0;
void throwSomeKnownException(void) {
throw SomeKnownException();
}
void throwSomeUnknownException(void) {
throw SomeUnkownException();
}
%}