Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock/TestFramework
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14929/DotNetMock/TestFramework
Modified Files:
MbUnitStubMaker.cs
Log Message:
BUG 1164782 : send new object[0] instead of null to MbUnit..AreEquals(object, object, string, params object[])
Index: MbUnitStubMaker.cs
===================================================================
RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock/TestFramework/MbUnitStubMaker.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** MbUnitStubMaker.cs 29 Jan 2005 09:13:32 -0000 1.2
--- MbUnitStubMaker.cs 8 Apr 2005 02:12:12 -0000 1.3
***************
*** 46,58 ****
if ( hasMessageParameter )
{
parameterTypes.RemoveAt(0);
parameterTypes.Add(typeof(string));
! for (int i = 1; i<parameterTypes.Count; ++i)
{
EmitLdarg(ilg, i+1);
}
EmitLdarg(ilg, 1);
! parameterTypes.Add(typeof(object[]));
! ilg.Emit(OpCodes.Ldnull);
}
else
--- 46,65 ----
if ( hasMessageParameter )
{
+ // original parameter count
+ int n = parameterTypes.Count;
+ // edit call signature
parameterTypes.RemoveAt(0);
parameterTypes.Add(typeof(string));
! parameterTypes.Add(typeof(object[]));
! // push arguments starting after message arg 1
! for (int i = 1; i<n; ++i)
{
EmitLdarg(ilg, i+1);
}
+ // load format/message from arg 1
EmitLdarg(ilg, 1);
! // add empty object[] array
! ilg.Emit(OpCodes.Ldc_I4_0);
! ilg.Emit(OpCodes.Newarr, typeof(object));
}
else
|