test: fixed `assert' selftest for release-only mac builds

This test intentionally crashes itself by using Q_ASSERT.

Since Q_ASSERT is a no-op in release builds, the .pro file was
attempting to always force debug mode for this project.

However, on platforms where debug vs release affect linkage (e.g. mac
and windows), this is invalid.  On these platforms, debug mode can't be
enabled unless debug versions of the Qt libraries are available, which
they are not if Qt is configured with `-no-debug-and-release -release'.

Use a different method to ensure that Q_ASSERT really asserts, for both
debug and release builds.

Change-Id: I13eea2c72c77a0a981850dbcaa77f65f147c8490
Reviewed-on: http://codereview.qt.nokia.com/4015
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
bb10
Rohan McGovern 2011-09-01 08:43:18 +10:00 committed by Qt by Nokia
parent 2438a5ad48
commit 949be8cbdd
2 changed files with 4 additions and 2 deletions

View File

@ -8,7 +8,5 @@ QT = core
mac:CONFIG -= app_bundle
CONFIG -= debug_and_release_target
!win32:CONFIG += debug
TARGET = assert

View File

@ -39,6 +39,10 @@
**
****************************************************************************/
// Make sure we get a real Q_ASSERT even in release builds
#ifdef QT_NO_DEBUG
# undef QT_NO_DEBUG
#endif
#include <QtCore>
#include <QtTest/QtTest>