[Mono-list] Errormessage running Nunit on Mac Leopard

Charlie Poole charlie at nunit.com
Tue May 6 09:57:04 EDT 2008


Hi Ben, 

The test output seems correct. It gives the failure message and the stack
trace for where the failure occurred. What seems wrong about it to you?

I would prefer to see the stack trace filtered a little better - the entries

for nunit.core have been removed correctly but the System.Reflection entries
are kept. That's too much information for an assertion failure.

You're using an antique version of NUnit, which is still bundled with Mono.
:-)
If you (or someone else) can replicate this on 2.4.7 or the 2.5 alpha, I'll
update the filtering to remove any excess entries.

Charlie

> -----Original Message-----
> From: mono-list-bounces at lists.ximian.com 
> [mailto:mono-list-bounces at lists.ximian.com] On Behalf Of Ben Aurel
> Sent: Tuesday, May 06, 2008 4:06 AM
> To: mono-list at lists.ximian.com
> Subject: [Mono-list] Errormessage running Nunit on Mac Leopard
> 
> hi
> I've built mono from sources on my Mac 10.5.2 which went fine 
> (mostly I guess).
> $ mcs HelloWorld.cs
> $ mono HelloWolrd.exe
> Hello World!
> 
> that went fine so far... Now I wanted to take it to the next 
> step by writing a simple nunit test: (sources from the 
> nunit-site, see below):
> 
> $ mcs -t:library Account.cs [1]
> $ mcs -pkg:dotnet -r:Nunit.Framework -r:Account -t:library 
> AccountTest.cs [2]
> 
> $ nunit-console AccountTest.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 9.2.2.0    Mono Version: 1.1.4322.2032
> 
> .F
> 
> Tests run: 1, Failures: 1, Not run: 0, Time: 0.041441 seconds
> 
> Tests run: 1, Failures: 1, Not run: 0, Time: 0.041441 seconds
> 
> Failures:
> 1) bank.AccountTest.TransferFunds :
> 	expected:<250>
> 	 but was:<150>
> 
> and then a strange MESSAGE:
> 
>   at bank.AccountTest.TransferFunds () [0x00000]
>   at (wrapper managed-to-native)
> System.Reflection.MonoMethod:InternalInvoke
> (object,object[],System.Exception&)
>   at System.Reflection.MonoMethod.Invoke (System.Object obj, 
> BindingFlags invokeAttr, System.Reflection.Binder binder, 
> System.Object[] parameters, System.Globalization.CultureInfo 
> culture) [0x00041] in 
> ~/mono/compiling/mcs/class/corlib/System.Reflection/MonoMethod.cs:157
> 
> I don't think this reference to MonoMethod.cs:157 is normal. 
> What is wrong here?
> 
> Thanks in advance.
> Ben
> 
> [1] Account.cs
>   public class Account
>   {
>     private float balance;
>     public void Deposit(float amount)
>     {
>       balance+=amount;
>     }
> 
>     public void Withdraw(float amount)
>     {
>       balance-=amount;
>     }
> 
>     public void TransferFunds(Account destination, float amount)
>     {
>     }
> 
>     public float Balance
>     {
>       get{ return balance;}
>     }
>   }
> }
> 
> 
> [2] AccountTest.cs
> namespace bank
> {
>   using NUnit.Framework;
> 
>   [TestFixture]
>   public class AccountTest
>   {
>     [Test]
>     public void TransferFunds()
>     {
>       Account source = new Account();
>       source.Deposit(200.00F);
>       Account destination = new Account();
>       destination.Deposit(150.00F);
> 
>       source.TransferFunds(destination, 100.00F);
>       Assert.AreEqual(250.00F, destination.Balance);
>       Assert.AreEqual(100.00F, source.Balance);
> 	
>     }
>   }
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com 
> http://lists.ximian.com/mailman/listinfo/mono-list
> 





More information about the Mono-list mailing list