[Kmymoney-devel] CSV Importer Plugin

Thomas Baumgart thb at net-bembel.de
Sat Feb 27 14:44:59 CET 2010


Hi,

on Saturday 27 February 2010 aga wrote:


[...]

> > That's what they are there for. Be aware, that sometimes the testcase is
> > erroneous.
> 
> Hi Thomas and all
> 
> It was a bit of a silly, really.  The convdate routine needs to know the
>  date format, which the user sets via the GUI.  The unit test though knows
>  nothing of the GUI, so I need to hard code the value of the format to use.
>   I'd done that previously, but rushing to get the patches to you, I'd
>  forgotten to set that value, and the unit test was expecting US format
>  dates rather than the UK ones I'd set up.
> 
> Which brings me to localisation.  In general, I need to sort this out
> properly, but for unit testing, is localisation necessary?  I've hard coded
> the dates as QStrings, because the dates the convdate routine uses are the
> strings from the statement input.  In unit test, these aren't, I would have
> thought, going to see the light of day for the normal user.

Well, that depends. If your code is sensitive to the locale format, you should 
test it with all those that are supported.   
MyMoneyMoneyTest::testStringConstructor(), 
MyMoneyMoneyTest::testSetDecimalSeparator() and 
MyMoneyMoneyTest::testSetThousandSeparator()

may give you some idea on how I did it there.

-- 


Regards

Thomas Baumgart

GPG-FP: E55E D592 F45F 116B 8429   4F99 9C59 DB40 B75D D3BA
-------------------------------------------------------------
'I used *that other operating system* (now to be considered
open source? <g>) for some years' - anonymous source
-------------------------------------------------------------
-------------- 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/20100227/b56f29f3/attachment.sig 


More information about the KMyMoney-devel mailing list