From 2b4f480f34706b7483df0b91ec36b03eb1b38ab1 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Sun, 30 May 2004 08:02:16 +0000 Subject: [PATCH] more tests added to test all the generic throws typemaps git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5950 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Examples/test-suite/throw_exception.i | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Examples/test-suite/throw_exception.i b/Examples/test-suite/throw_exception.i index 14b17bca8..a67ce5c6d 100644 --- a/Examples/test-suite/throw_exception.i +++ b/Examples/test-suite/throw_exception.i @@ -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: } }; - %} +%}