Question about unittesting

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


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

>> if (application_is_in_debug_mode) {
>> //do some testing
>> }
>
> How would a macro make things different?
> Something like
> IF_DEBUG_MODE {
>   // 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  
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())
    qFatal("my code is crap");
#endif

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

*shrug*,
Thomas




More information about the kde-core-devel mailing list