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

Graeme Geldenhuys graemeg.lists at gmail.com
Mon May 22 17:01:08 CEST 2006


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.


---------- sample xml test output  ------------------
<Failure>
  <Message>TTestTIUtils.tiFloatToCurrency: Failed on 4 expected: <$
0.01> but was: <$ 0.00></Message>
  <ExceptionClass>EAssertionFailedError</ExceptionClass>
  <ExceptionMessage>Failed on 4 expected: <$ 0.01> but was: <$
0.00></ExceptionMessage>
</Failure>

<Error>
  <Message>TTestTIUtils.tiVariantArrayToString: Variant array locked</Message>
  <ExceptionClass>EVariantArrayLockedError</ExceptionClass>
  <ExceptionMessage>Variant array locked</ExceptionMessage>
  <SourceUnitName></SourceUnitName>
  <LineNumber>1702</LineNumber>
  <FailedMethodName></FailedMethodName>
</Error>
-------------------------------------------------------


Where in SubVersion are the fpc tests located?


Regards,
  - Graeme -




On 5/22/06, Vincent Snijders <vsnijders at quicknet.nl> wrote:
> Graeme Geldenhuys schreef:
> > On 5/22/06, Florian Klaempfl <florian at freepascal.org> wrote:
> The results are gathered and published on:
> http://www.freepascal.org/cgi-bin/testsuite.cgi
>
> Vincent.
>
>
> _______________________________________________
> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-devel
>


-- 
There's no place like 127.0.0.1


More information about the fpc-devel mailing list