[Mono-bugs] [Bug 73007][Nor] New - Mono throws exception unexpectedly when usingNUnit.Mocks in some cases

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Fri, 25 Feb 2005 02:43:24 -0500 (EST)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by jrodman@ximian-bugzilla.spamportal.net.

http://bugzilla.ximian.com/show_bug.cgi?id=73007

--- shadow/73007	2005-02-25 02:43:24.000000000 -0500
+++ shadow/73007.tmp.24515	2005-02-25 02:43:24.000000000 -0500
@@ -0,0 +1,99 @@
+Bug#: 73007
+Product: Mono: Runtime
+Version: 1.1
+OS: SLES 9
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: remoting
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: jrodman@ximian-bugzilla.spamportal.net               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Mono throws exception unexpectedly when usingNUnit.Mocks in some cases
+
+The attached code produces the following correct result when executed under
+MS/.Net 1.1:
+
+$ /cygdrive/c/NUnit-bs/bin/nunit-console.exe bin/Debug/mocktest.dll
+NUnit version 2.2.0
+Copyright (C) 2002-2003 James W. Newkirk, Michael C. Two, Alexei A.
+Vorontsov, Charlie Poole.
+Copyright (C) 2000-2003 Philip Craig.
+All Rights Reserved.
+
+OS Version: Microsoft Windows NT 5.2.3790.0    .NET Version: 1.1.4322.2032
+
+.F
+Tests run: 1, Failures: 1, Not run: 0, Time: 0.0701008 seconds
+
+Failures:
+1) mocktest.AnulledExitTests.OtherTest :
+        expected:<mocktest.AnulledExitTests+OtherObject>
+         but was:<(null)>
+   at mocktest.AnulledExitTests.OtherTest() in
+c:\src\mocktest\class1.cs:line 33
+
+Under Mono 1.0.5 as well as 1.1.4+ (SVN head as of Wed 23, February 2005)
+an exception within Mono itself results.  This exception is displayed 
+differently by NUnit running under the different Mono versions, this is
+the output under Mono 1.0.5:
+
+bryan@surfboard:~/work/bugscan2/build/build/build> nunit-console.exe
+breaking-test.dll
+NUnit version 2.2.0
+Copyright (C) 2002-2003 James W. Newkirk, Michael C. Two, Alexei A.
+Vorontsov, Charlie Poole.
+Copyright (C) 2000-2003 Philip Craig.
+All Rights Reserved.
+
+OS Version: Unix 2.6.5.7    Mono Version: 1.1.4322.573
+
+.F
+Tests run: 1, Failures: 1, Not run: 0, Time: 0.057892 seconds
+
+Failures:
+1) tests.DataFlowTests.AnulledExitTests.OtherTest :
+System.NullReferenceException : Object reference not set to an instance of
+an object
+in <0x00045> OtherObject:Equals (object)
+in <0x00126> tests.DataFlowTests.AnulledExitTests:OtherTest ()
+in (unmanaged) (wrapper managed-to-native)
+System.Reflection.MonoMethod:InternalInvoke (object,object[])
+in <0x00004> (wrapper managed-to-native)
+System.Reflection.MonoMethod:InternalInvoke (object,object[])
+in <0x00097> System.Reflection.MonoMethod:Invoke
+(object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo)
+
+
+Here is the output under Mono 1.1.4+:
+bryan@surfboard:~/work/bugscan2/build/build/build>
+/opt/monosvnhead/bin/mono $(which nunit-console.exe) breaking-test.dll
+NUnit version 2.2.0
+Copyright (C) 2002-2003 James W. Newkirk, Michael C. Two, Alexei A.
+Vorontsov, Charlie Poole.
+Copyright (C) 2000-2003 Philip Craig.
+All Rights Reserved.
+
+OS Version: Unix 2.6.5.7    Mono Version: 1.1.4322.573
+
+.F
+Tests run: 1, Failures: 1, Not run: 0, Time: 0.046141 seconds
+
+Failures:
+1) tests.DataFlowTests.AnulledExitTests.OtherTest :
+System.NullReferenceException : Object reference not set to an instance of
+an object
+in <unknown method>
+in <0x0000f> System.Reflection.MonoMethod:InternalInvoke (System.Object ,
+System.Object[] )
+in <0x000ac> System.Reflection.MonoMethod:Invoke (System.Object obj,
+BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[]
+parameters, System.Globalization.CultureInfo culture)
+
+Note the behavior is the same whether the code is compiled under Mono
+1.0.5 or Mono 1.1.4+.