add allowexcept feature test
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@8669 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
14a5d7f762
commit
5241939f7a
2 changed files with 32 additions and 0 deletions
31
SWIG/Examples/test-suite/allowexcept.i
Normal file
31
SWIG/Examples/test-suite/allowexcept.i
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
// Test the allowexcept feature by making the usual $action uncompileable and ensuring the %exception is picked up
|
||||
|
||||
%module allowexcept
|
||||
|
||||
struct XYZ {
|
||||
};
|
||||
|
||||
%{
|
||||
struct XYZ {
|
||||
void foo() {}
|
||||
private:
|
||||
XYZ& operator=(const XYZ& other); // prevent assignment used in normally generated set method
|
||||
XYZ* operator&(); // prevent dereferencing used in normally generated get method
|
||||
};
|
||||
%}
|
||||
|
||||
%exception {
|
||||
/*
|
||||
$action
|
||||
*/
|
||||
}
|
||||
%feature("allowexcept");
|
||||
|
||||
%inline %{
|
||||
XYZ global_variable;
|
||||
struct ABC {
|
||||
XYZ member_variable;
|
||||
static XYZ static_member_variable;
|
||||
};
|
||||
%}
|
||||
|
||||
|
|
@ -73,6 +73,7 @@ CPP_TEST_CASES += \
|
|||
access_change \
|
||||
add_link \
|
||||
aggregate \
|
||||
allowexcept \
|
||||
anonymous_bitfield \
|
||||
argout \
|
||||
array_member \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue