summaryrefslogtreecommitdiff
path: root/Examples/test-suite/director_exception.i
diff options
context:
space:
mode:
Diffstat (limited to 'Examples/test-suite/director_exception.i')
-rw-r--r--Examples/test-suite/director_exception.i28
1 files changed, 27 insertions, 1 deletions
diff --git a/Examples/test-suite/director_exception.i b/Examples/test-suite/director_exception.i
index 3fd3e563c..2559ae566 100644
--- a/Examples/test-suite/director_exception.i
+++ b/Examples/test-suite/director_exception.i
@@ -1,5 +1,7 @@
%module(directors="1") director_exception
+%warnfilter(SWIGWARN_TYPEMAP_DIRECTOROUT_PTR) return_const_char_star;
+
%{
#if defined(_MSC_VER)
@@ -106,7 +108,7 @@ Foo *launder(Foo *f) {
%}
%feature("director") Bar;
-
+%feature("director") ReturnAllTypes;
%inline %{
struct Exception1
@@ -132,4 +134,28 @@ Foo *launder(Foo *f) {
virtual std::string pang() throw () { return "Bar::pang()"; }
};
+ // Class to allow regression testing SWIG/PHP not checking if an exception
+ // had been thrown in directorout typemaps.
+ class ReturnAllTypes
+ {
+ public:
+ int call_int() { return return_int(); }
+ double call_double() { return return_double(); }
+ const char * call_const_char_star() { return return_const_char_star(); }
+ std::string call_std_string() { return return_std_string(); }
+ Bar call_Bar() { return return_Bar(); }
+
+ virtual int return_int() { return 0; }
+ virtual double return_double() { return 0.0; }
+ virtual const char * return_const_char_star() { return ""; }
+ virtual std::string return_std_string() { return std::string(); }
+ virtual Bar return_Bar() { return Bar(); }
+ virtual ~ReturnAllTypes() {}
+ };
+
+#ifdef SWIGPYTHON_BUILTIN
+bool is_python_builtin() { return true; }
+#else
+bool is_python_builtin() { return false; }
+#endif
%}