[Digikam-devel] Unit Tests

Michael G. Hansen mikeml2 at pfna.de
Thu Dec 29 14:36:58 GMT 2011


Hi Andi,

On 12/29/2011 01:37 PM, Andi Clemens wrote:
> I ran the unittest suite and 7 tests failed.
> I took a look at some of them and came across the test
> "test_kmlexport_gpxparsing", which I don't understand.
> The test "testQDateTimeParsing" doesn't make sense to me, we test Qt
> functions (why?) and always fail when comparing a time with
> QCOMPARE(time1.time(), QTime(0, 0, 0));
> which is always false.

yes, we do test Qt functions here because the behavior of one of the 
parsing functions changed with a version change in Qt. There was a 
change in how they interpret the timezone offset. I will adapt them to 
what the current version of Qt does.

> The comment for the test says something about the Nokia N900, where this
> test seems to be true, but on a PC it fails.
> We shouldn't add a test that will always fail on a PC, platform specific
> tests should only be build on that particular platform.

The data was from the log of an N900, and I wanted to check whether Qt 
parses it correctly, because there was a bug-report about parsing errors.

I will look into better documenting them and either removing or ifdefing 
the tests depending on a specific version of Qt.

Michael



More information about the Digikam-devel mailing list