add allowexcept feature test
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8669 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
45a045b9f1
commit
3e5ab0a5d2
2 changed files with 32 additions and 0 deletions
31
Examples/test-suite/allowexcept.i
Normal file
31
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;
|
||||
};
|
||||
%}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue