[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: Question about unittesting
From:       Dario Freddi <drf54321 () gmail ! com>
Date:       2012-04-09 11:43:24
Message-ID: CAFFVnfMu1YfJk=Ve2e07EFd3hJDEJYuakVrFwPeH2Y3aCqgpuQ () mail ! gmail ! com
[Download RAW message or body]

Il 08 aprile 2012 23:12, Thomas Zander <zander@kde.org> ha scritto:
> On Sunday 08 April 2012 22.57.05 Thomas L=FCbking wrote:
>> I think he wants a macro to execute a branch only in debug compilation
>> mode,
>> ie. he's probably looking for Q_ASSERT(deleteSuccedded(path));
>> or in doubt sth. stronger than debug that only acts on testing, ie. a
>> global cmake
>> option "TEST_MODE", so that he can
>> # if TEST_MODE
>> if (!deleteSucceeded())
>> =A0 =A0 qFatal("my code is crap");
>> #endif
>
> compiling a different exe for testing that behaves differently sounds bad=
 to me.

I agree, it defeats the whole purpose of testing - after all, we're
not testing the code path the end user would use, I can see such a
thing make it harder to spot problems instead. QTest covers every
possible need, and Q_ASSERT should be enough for having the program
behave differently when compiled in debug mode in a sensible way.
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic