Hi all,
I am working on a programm where I intentionally throw exceptions under certain circumstances - i.e. range checks, floating point operations, etc., transporting FPC behaviour on standard types to my own non-standard types.
Now I want to test that these exceptions are actually working in the intended way without requesting any user intervention when running the test cycle. From what I have read so far this seems not possible.
The only way to solve this that I found, is defining a special test-mode compile - e.g. {$define TEST_EXCPT} - and at the place where I throw the exception do a manipulation that can be checked by the testing routine. This solves it, but makes code a bit less readable due to added {$ifdef TEST_EXCPT} semantics.
Are there better alternatives to the approach above?
Cheers,
MathMan