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:
parent
fac3662444
commit
de340fa464
1 changed files with 13 additions and 1 deletions
|
|
@ -11,6 +11,8 @@ namespace Namespace {
|
||||||
typedef Error ErrorTypedef;
|
typedef Error ErrorTypedef;
|
||||||
typedef const Error& ErrorRef;
|
typedef const Error& ErrorRef;
|
||||||
typedef const Error* ErrorPtr;
|
typedef const Error* ErrorPtr;
|
||||||
|
typedef int IntArray[10];
|
||||||
|
enum EnumTest { enum1, enum2 };
|
||||||
};
|
};
|
||||||
class Foo {
|
class Foo {
|
||||||
public:
|
public:
|
||||||
|
|
@ -42,6 +44,16 @@ public:
|
||||||
static Error StaticError;
|
static Error StaticError;
|
||||||
throw 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) {
|
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";
|
||||||
|
|
@ -49,5 +61,5 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue