TARGET_JVM: sometimes JAVA has a wider exception hierarchy, i.e. ArrayIndexOutOfBound...
authorKonstantin Triger <kostat@mono-cvs.ximian.com>
Thu, 7 Dec 2006 07:50:52 +0000 (07:50 -0000)
committerKonstantin Triger <kostat@mono-cvs.ximian.com>
Thu, 7 Dec 2006 07:50:52 +0000 (07:50 -0000)
svn path=/trunk/mcs/; revision=69157

mcs/nunit20/core/ExpectedExceptionTestCase.cs

index 4a76310dcfc5b5798563b61b47f13ed3bf7caa2f..338470a98b363f144d1fe0b91f178f58989b65ea 100644 (file)
@@ -65,7 +65,11 @@ namespace NUnit.Core
 
                protected override internal void ProcessException(Exception exception, TestCaseResult testResult)
                {
+#if TARGET_JVM //sometimes JAVA has a wider exception hierarchy, i.e. ArrayIndexOutOfBoundsException : IndexOutOfBoundsException; we ignore this.
+                       if (expectedException.IsAssignableFrom(exception.GetType()))
+#else
                        if (expectedException.Equals(exception.GetType()))
+#endif
                        {
                                if (expectedMessage != null && !expectedMessage.Equals(exception.Message))
                                {