[Kmymoney-devel] CSV Importer Plugin

Thomas Baumgart thb at net-bembel.de
Mon Feb 22 14:25:53 CET 2010


On Monday 22 February 2010 14:07:32 aga wrote:
> > > I've been doing a bit of reading up, and yes, I can see that.  Already,
> > > I've had to do a bit of redesign to allow testing.  Plus, I'm going to
> > > have to move some error messages for the same reason.
> > >
> > > Just thinking ahead slightly, so far I've been working on a
> > > free-standing version so as to get a simple executable and not mess
> > > things up in the process.  What I'm unclear on is integrating back into
> > > KMM.
> > >
> > > Is it something like 'make test' and then run as normal, or what?
> >
> > To run the tests, you have to enable the tests in cmake or ccmake.
> > Then, you make and make install, as usual, and finally you run make test
>
> Thanks for that.
>
> Sorry, but a couple more queries.
>
> Firstly, to do with testing.  I've concentrated so far on my date
> conversion routine, and I've been throwing a bunch of good and bad date
> formats at it.

In that case, it is a strick requirement for unit testing to know when you 
throw a good one and when a bad one. In either case you know the expected 
result and should check for it. Throwing a bad date format and detecting it 
is a PASSED.

> If a valid date is found, I can unit  test against the 
> expected output.

As said, you can also test for the expected output of a bad format, or am I 
missing something? I have to admit, I haven*t looked at any of this (yet).

> However, if an invalid date is found, not by unit test, 
> but by the checking routine, the error return just bypasses the unit test 
> ASSERT test.  Is that the proper way to handle a program detected error, or
> what?

Again, the unit test does not find anything related to the logic. It just 
finds if the behavior of a function is not as expected.

-- 

Regards

Thomas Baumgart

GPG-FP: E55E D592 F45F 116B 8429   4F99 9C59 DB40 B75D D3BA
-------------------------------------------------------------
Please avoid sending me Word or PowerPoint attachments.
 See http://www.gnu.org/philosophy/no-word-attachments.html
-------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 224 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/kmymoney-devel/attachments/20100222/2071bbd3/attachment.sig 


More information about the KMyMoney-devel mailing list