[fpc-devel] Definition of the time-fration in a TDateTime before 30/12/1899

Michael Van Canneyt michael at freepascal.org
Mon May 22 17:11:54 CEST 2006



On Mon, 22 May 2006, Graeme Geldenhuys wrote:

> Ok, so every set of tests is a actual program.
>
> [I am not forcing fpcUnit, just curious as what FPC's tests can do.
> Also not sure what your knowlegde is on the workings of a xUnit
> testing framework. ]
>
>
> So if you have to test something a little more complex, and every
> unittest needs some predefined state (example a set of objects need to
> be created or a database connection needs to be created) and then once
> the test has completed, those objects need to be freed or db
> connection closed.  That will add a lof of extra code to the FPC test
> framework as far as I can see.  Here is another big benefit of using a
> unittest framework like fpcUnit.  In fpcUnit I could add two methods
> to my TestCase class (Setup and TearDown) which will be called before
> and after each test without me have to wrap anything in a try..finally
> block etc.
>
> Another example will be to test a method that needs to raise an
> exception and you are testing for a specific type of exception.
>
> Also as part of the XML results generated by fpcUnit, is the line
> number a Error occured (unexpected result) including the exception
> that was raised, or the message string a test failure occured at (eg:
> 'Failed on 1' including the Actual and Expected results).
>
> Tests could also be grouped in test suites.

This is all correct. No-one questions the usefullness of fpcunit
(on the contrary), but the point is to test the compiler and RTL.
There are many tests which simply should fail when compiling,
or where the compiler should give a specific error.

-> You can't test that with fpcunit :-)

If we need to design tests for the "Inherited;" construct,
then you can't use fpcunit for that, since fpcunit relies
on "Inherited;" working correctly in the first place.

A kind of chicken-and-egg problem :-)

But more high-level routines could definitely be implemented using
fpcunit...

Michael.



More information about the fpc-devel mailing list