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:
parent
ffb2b6b73b
commit
130ae2cb26
3 changed files with 40 additions and 1 deletions
25
Examples/test-suite/c_backend_cpp_exception.i
Normal file
25
Examples/test-suite/c_backend_cpp_exception.i
Normal 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();
|
||||
}
|
||||
%}
|
||||
Loading…
Add table
Add a link
Reference in a new issue