Unit Tests

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Unit Tests

Andi Clemens
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.

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.

Do I misunderstand this test?

Andi

--
Using Opera's revolutionary email client: http://www.opera.com/mail/
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

Re: Unit Tests

Bugzilla from mikeml2@pfna.de
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
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

Re: Unit Tests

Michael G. Hansen
On 12/29/2011 03:36 PM, Michael G. Hansen wrote:

> 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.

Done!

Michael

_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

Re: Unit Tests

Andi Clemens
Ok!

:-)

Andi

On Thu, 29 Dec 2011 20:48:24 +0100, Michael G. Hansen <[hidden email]>  
wrote:

> On 12/29/2011 03:36 PM, Michael G. Hansen wrote:
>> 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.
>
> Done!
>
> Michael
>
> _______________________________________________
> Digikam-devel mailing list
> [hidden email]
> https://mail.kde.org/mailman/listinfo/digikam-devel


--
Using Opera's revolutionary email client: http://www.opera.com/mail/
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel