From ee16fd54e04db0bfca05fe4028194071a2b5feca Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Tue, 8 Mar 2005 22:06:53 +0000 Subject: [PATCH] Fix undefined behaviour when throwing exceptions git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7053 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- .../test-suite/csharp/csharp_exceptions_runme.cs | 13 ++++++------- Examples/test-suite/csharp/li_std_string_runme.cs | 4 ++-- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Examples/test-suite/csharp/csharp_exceptions_runme.cs b/Examples/test-suite/csharp/csharp_exceptions_runme.cs index 1c23a809f..add2e0853 100644 --- a/Examples/test-suite/csharp/csharp_exceptions_runme.cs +++ b/Examples/test-suite/csharp/csharp_exceptions_runme.cs @@ -54,12 +54,12 @@ public class runme try { csharp_exceptions.NullReference(null); throw new Exception("NullReference not working"); - } catch (NullReferenceException) { + } catch (ArgumentNullException) { } try { csharp_exceptions.NullValue(null); throw new Exception("NullValue not working"); - } catch (NullReferenceException) { + } catch (ArgumentNullException) { } // enums @@ -80,12 +80,12 @@ public class runme try { csharp_exceptions.NullStdStringValue(null); throw new Exception("NullStdStringValue not working"); - } catch (NullReferenceException) { + } catch (ArgumentNullException) { } try { csharp_exceptions.NullStdStringReference(null); throw new Exception("NullStdStringReference not working"); - } catch (NullReferenceException) { + } catch (ArgumentNullException) { } try { csharp_exceptions.ExceptionSpecificationStdStringValue(); @@ -114,7 +114,7 @@ public class runme try { new constructor(null); throw new Exception("constructor 1 not working"); - } catch (NullReferenceException) { + } catch (ArgumentNullException) { } try { new constructor(); @@ -278,7 +278,6 @@ public class runme Thread[] threads = new Thread[NUM_THREADS]; TestThread[] testThreads = new TestThread[NUM_THREADS]; // invoke the threads - Console.WriteLine("Thread tests"); for (int i=0; i