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
Loading
Please register or sign in to comment