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

Vincent Snijders vsnijders at quicknet.nl
Mon May 22 19:26:13 CEST 2006


Michael Van Canneyt wrote:
> 
> 
> 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...

I would propose to create a tests\fpunit and/or a tests\webfpu directory 
where fpunit testcase could be added.

This is not a replacement for the current method, since reports for IE 
or syntax errors cannot be adequately tested with it and in some / most 
cases a simple program showing the bug is easier to write and compiles 
faster (good for the fixer).

 From Greame I would like to know how he proposes to update the 
TestSuite, if a new tests it added.

For the current test method, this is not an issue, since all programs in 
  a directory are compiled.

Vincent.



More information about the fpc-devel mailing list