Added test that checks the order between the global %except handler and local throw() definitions
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4766 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
97c0e312d2
commit
20bf783966
3 changed files with 47 additions and 1 deletions
|
|
@ -43,10 +43,11 @@ DYNAMIC_LIB_PATH = $(RUNTIMEDIR):.
|
|||
# Broken C++ test cases. (Can be run individually using make testcase.cpptest.)
|
||||
CPP_TEST_BROKEN += \
|
||||
array_typedef_memberin \
|
||||
exception_order \
|
||||
template_default_arg \
|
||||
template_specialization_defarg \
|
||||
template_specialization_enum \
|
||||
using_namespace
|
||||
using_namespace
|
||||
|
||||
# Broken C test cases. (Can be run individually using make testcase.ctest.)
|
||||
C_TEST_BROKEN +=
|
||||
|
|
|
|||
31
Examples/test-suite/exception_order.i
Normal file
31
Examples/test-suite/exception_order.i
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
%module exception_order
|
||||
|
||||
%include "exception.i"
|
||||
|
||||
#if 1
|
||||
%exception {
|
||||
try {
|
||||
$action
|
||||
} catch(...) {
|
||||
SWIG_exception(SWIG_RuntimeError,"Unknown exception");
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
%inline %{
|
||||
|
||||
|
||||
struct E
|
||||
{
|
||||
};
|
||||
|
||||
struct A
|
||||
{
|
||||
int foo() throw(E)
|
||||
{
|
||||
throw E();
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
%}
|
||||
14
Examples/test-suite/python/exception_order_runme.py
Normal file
14
Examples/test-suite/python/exception_order_runme.py
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import exception_order
|
||||
|
||||
|
||||
a = exception_order.A()
|
||||
|
||||
try:
|
||||
a.foo()
|
||||
except RuntimeError,e:
|
||||
if e.args[0] != "E":
|
||||
print "bad exception order",
|
||||
raise RuntimeError, e.args
|
||||
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue