More comprehensive exception specification tests added.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5942 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2004-05-29 15:09:25 +00:00
commit d6de9a311f

View file

@ -7,6 +7,11 @@
class Error { class Error {
}; };
namespace Namespace {
typedef Error ErrorTypedef;
typedef const Error& ErrorRef;
typedef const Error* ErrorPtr;
};
class Foo { class Foo {
public: public:
void test_int() throw(int) { void test_int() throw(int) {
@ -18,6 +23,25 @@ public:
void test_cls() throw(Error) { void test_cls() throw(Error) {
throw Error(); throw Error();
} }
void test_cls_ptr() throw(Error *) {
static Error StaticError;
throw &StaticError;
}
void test_cls_ref() throw(Error &) {
static Error StaticError;
throw StaticError;
}
void test_cls_td() throw(Namespace::ErrorTypedef) {
throw Error();
}
void test_cls_ptr_td() throw(Namespace::ErrorPtr) {
static Error StaticError;
throw &StaticError;
}
void test_cls_ref_td() throw(Namespace::ErrorRef) {
static Error StaticError;
throw StaticError;
}
void test_multi(int x) throw(int, const char *, Error) { void test_multi(int x) throw(int, const char *, Error) {
if (x == 1) throw 37; if (x == 1) throw 37;
if (x == 2) throw "Dead"; if (x == 2) throw "Dead";