Question about unittesting

Thomas L├╝bking thomas.luebking at
Sun Apr 8 21:57:05 BST 2012

Am 08.04.2012, 22:39 Uhr, schrieb Kevin Krammer <krammer at>:

>> if (application_is_in_debug_mode) {
>> //do some testing
>> }
> How would a macro make things different?
> Something like
>   // do some testing
> }
> so the developer does not have to remember how to check a command line
> argument's value?

I think he wants a macro to execute a branch only in debug compilation  
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 (!deleteSucceeded())
    qFatal("my code is crap");

or even simplifying to
TEST(deleteSucceeded(), "my code is crap");
analogous to Q_ASSERT_X usage


More information about the kde-core-devel mailing list