shekharpro / mb-unit

Automatically exported from code.google.com/p/mb-unit
0 stars 0 forks source link

FibonacciTest in online book is breaking the test frameworks. #419

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

1. Install "Gallio v3.0.6 Update 1 build 763 - x64 installer"

2. Using PC with WinXP 64 installed and lastest microsoft patches. Using
VS2008 pro with .net 3.1 sp, VS sp, MVC 1.0, Test-Driven.net personal,
various stuff that SQL Server 2008 developer edition adds to VS.

3. A very basic test will not run. This is the "FibonacciTest" from your
online book (Assert.AreEqual(Fibonacci.Calculate(6), 8);)

What is the expected output? What do you see instead?

This failed when I tried to run it with Icarus and Test-Driven.net. It also
failed when I tried to do it with NUnit 2.5 in place of MbUnit. I guess the
problem is with the Fibonacci example. I suggest you replace the Fibonacci
example in your online book with one which doesn't use recursion.

Original issue reported on code.google.com by mark4...@gmail.com on 11 Apr 2009 at 12:20

GoogleCodeExporter commented 8 years ago
So it appears that the Fibonacci example contains a bug.  Namely, it recurses 
forever
which eventually causes a Stack Overflow to occur.  The CLR then performs a 
FailFast
and kills the test process.

.Net based test frameworks have a very difficult time dealing with stack 
overflows
because the whole process just dies, no exception is thrown so nothing can be 
handled.

In the future I'd like to make MbUnit more resilient by running individual tests
out-of-process so we can recover from death of the test process more gracefully.

Original comment by jeff.br...@gmail.com on 11 Apr 2009 at 7:08

GoogleCodeExporter commented 8 years ago
Fixed in the docs.

Original comment by jeff.br...@gmail.com on 27 Apr 2009 at 5:44