More comprehensive exception specification tests added.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5942 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
796b934b8a
commit
9f2060e608
1 changed files with 27 additions and 3 deletions
|
|
@ -7,16 +7,40 @@
|
|||
class Error {
|
||||
};
|
||||
|
||||
namespace Namespace {
|
||||
typedef Error ErrorTypedef;
|
||||
typedef const Error& ErrorRef;
|
||||
typedef const Error* ErrorPtr;
|
||||
};
|
||||
class Foo {
|
||||
public:
|
||||
void test_int() throw(int) {
|
||||
throw 37;
|
||||
throw 37;
|
||||
}
|
||||
void test_msg() throw(const char *) {
|
||||
throw "Dead";
|
||||
throw "Dead";
|
||||
}
|
||||
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) {
|
||||
if (x == 1) throw 37;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue