andrewkeller/REALbasic-Common-KFS-BSD — Issue #70: Terminal assertion failures are not recorded if the exception is swallowed
Author: andrewkeller
Created: 2011-11-21 15:20:51+00:00
State: open
Labels: master qa

If a terminal assertion fails, it is only recorded if the exception remains uncaught all the way to the UnitTestArbiterKFS object. If any code swallows (catches and does not raise again) the exception, then the assertion failure is not recorded.

This behavior is intentional, however it has an unintended concequence: if you are testing code that is supposed to swallow exceptions, then you cannot use terminal assertions (you must make them nonterminal).

The Unit Testing Framework should be modified so that terminal assertions are stashed just like nonterminal assertions. The exception is still required for proper code flow, but if the exception is always stashed, then the exception will be at least recorded if the exception is caught.

**Open Items:**

* What do we do with code that fails an assertion and swallows it intentionally?
* Answer: That's bad practice - it shouldn't have been written that way to begin with.

**Impact:**

* The UnitTestArbiterKFS class can no longer naievely collect exceptions from the test case - it must now eliminate duplicates.