test new exception mechanism in multithreaded environment
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6970 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
ab006f5428
commit
ffa8942be1
2 changed files with 73 additions and 0 deletions
|
|
@ -155,3 +155,24 @@ unsigned short ushorttest() { return 100; }
|
|||
exception_macro_run_flag = true;
|
||||
}
|
||||
%}
|
||||
|
||||
// exceptions in multiple threads test
|
||||
%exception ThrowsClass::ThrowException(long long input) {
|
||||
try {
|
||||
$action
|
||||
} catch (long long d) {
|
||||
char message[64];
|
||||
sprintf(message, "%lld", d);
|
||||
SWIG_CSharpSetPendingException(SWIG_CSharpArgumentOutOfRangeException, message);
|
||||
}
|
||||
}
|
||||
%inline %{
|
||||
struct ThrowsClass {
|
||||
double dub;
|
||||
ThrowsClass(double d) : dub(d) {}
|
||||
long long ThrowException(long long input) {
|
||||
throw input;
|
||||
return input;
|
||||
}
|
||||
};
|
||||
%}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue