From f23a4c2ef79eeb224e24cc7a3a03fb62cb8a0a6a Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Wed, 11 Jun 2003 09:16:40 +0000 Subject: [PATCH] protected and private destructor test git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4887 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- .../csharp/default_constructor_runme.cs | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 SWIG/Examples/test-suite/csharp/default_constructor_runme.cs diff --git a/SWIG/Examples/test-suite/csharp/default_constructor_runme.cs b/SWIG/Examples/test-suite/csharp/default_constructor_runme.cs new file mode 100644 index 000000000..7379d7a38 --- /dev/null +++ b/SWIG/Examples/test-suite/csharp/default_constructor_runme.cs @@ -0,0 +1,23 @@ +using System; + +public class runme +{ + static void Main() + { + // calling protected destructor test + try { + using (G g = new G()) { + } + throw new Exception("Protected destructor exception should have been thrown"); + } catch (MethodAccessException e) { + } + + // calling private destructor test + try { + using (FFF f = new FFF()) { + } + throw new Exception("Private destructor exception should have been thrown"); + } catch (MethodAccessException e) { + } + } +}