Skip to content
Commit 8737ace0 authored by Kevin Funk's avatar Kevin Funk
Browse files

Add another debug helper: DEBUG_ASSERT(cond, stmt)

Please refer to the doxygen documentation to see how to use it. It's
basically a copy of QTC_ASSERT from Qt Creator.

It's very useful for applying (what I call) "soft" assertions, to
replace code like this in one line:
 * bool someMethod() {
 *   if (!pointer)
 *     qWarning() << "Warning pointer is null, aborting";
 *     return false;
 *   (...)
 *   return someBoolean;

If code is triggered, a warning is printing which tells you where the
assertion happened. Additionally, stmt is evaluated so you can actually
leave the function safely.

Sending a copy to amarok-devel so people know that this exists and they
can use it.

CCMAIL: amarok-devel@kde.org
parent 8a7f4889
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment