more tests added to test all the generic throws typemaps

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5950 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2004-05-30 08:02:16 +00:00
commit de340fa464

View file

@ -11,6 +11,8 @@ namespace Namespace {
typedef Error ErrorTypedef;
typedef const Error& ErrorRef;
typedef const Error* ErrorPtr;
typedef int IntArray[10];
enum EnumTest { enum1, enum2 };
};
class Foo {
public:
@ -42,6 +44,16 @@ public:
static Error StaticError;
throw StaticError;
}
void test_array() throw(Namespace::IntArray) {
static Namespace::IntArray array;
for (int i=0; i<10; i++) {
array[i] = i;
}
throw array;
}
void test_enum() throw(Namespace::EnumTest) {
throw Namespace::enum2;
}
void test_multi(int x) throw(int, const char *, Error) {
if (x == 1) throw 37;
if (x == 2) throw "Dead";
@ -49,5 +61,5 @@ public:
}
};
%}
%}