[Mono-list] RFC: Corlib Unit Test on Linux How-To

Dietmar Maurer dietmar@ximian.com
30 Apr 2002 08:12:27 +0200


On Tue, 2002-04-30 at 04:57, Linus Upson wrote:
> I found the problem. When unwinding the stack in exceptions.c a test was
> using EIP when it should have used EBP.

just committed your fix - thanks.

 There was a similar typo in the
> exceptions docs file.

At least i have documented the error ;-)

 A patch for both is attached. It is just dumb luck
> that on Linux the top of the stack is at a larger address than the code.
> 
> Other things I found along the way and am looking in to:
> 
> - MethodInfo.GetMethod(System.String) doesn't work on mono. The overload
> which takes an array of parameter Types does, however.
> 
> - .Net's implementation of MethodInfo.Invoke() catches all Exceptions
> (need to check if it also catches non-CLS exceptions) and wraps them in
> a TargetInvocationException before throwing that to the caller. Mono
> lets the original exception pass through.

if so, we can catch them in the class lib.

> 
> - I have a vague recollection of reading somewhere that .Net doesn't run
> finally clauses until it finds a matching catch block for the exception.

really - that sounds strange.

> Mono calls the finally blocks as it unwinds the stack. I'm scratching my
> head to figure out if it matters. I'm going to write some tests to see
> if I can find any ways in which mono's behavior differs from .Net in
> this area.

yes, more tests would be good (we already have some tests in
mono/mono/tests/exception*.cs)
> 
> Now that the corlib unit tests are kind of working on windows, I'm
> working on a test case for MethodInfo as I go. Please let me know if I
> should enter these issues in bugzilla as well.

I prefer patches ;-) If you find errors you don't want to fix yourself
enter them into bugzilla.

- Dietmar