summaryrefslogtreecommitdiffstats
path: root/tests/auto/selftests
diff options
context:
space:
mode:
authorRohan McGovern <rohan.mcgovern@nokia.com>2011-09-01 08:43:18 +1000
committerQt by Nokia <qt-info@nokia.com>2011-09-01 23:55:39 +0200
commit949be8cbdd2d346647accbbd9bdab879256470ec (patch)
tree4de90efb0f252bcb60f4b5e24ae8ab7b2b07e85b /tests/auto/selftests
parent2438a5ad48014ca0828ee417616358ea171826aa (diff)
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>
Diffstat (limited to 'tests/auto/selftests')
-rw-r--r--tests/auto/selftests/assert/assert.pro2
-rw-r--r--tests/auto/selftests/assert/tst_assert.cpp4
2 files changed, 4 insertions, 2 deletions
diff --git a/tests/auto/selftests/assert/assert.pro b/tests/auto/selftests/assert/assert.pro
index e8d60bda6d..a1ed578a31 100644
--- a/tests/auto/selftests/assert/assert.pro
+++ b/tests/auto/selftests/assert/assert.pro
@@ -8,7 +8,5 @@ QT = core
mac:CONFIG -= app_bundle
CONFIG -= debug_and_release_target
-!win32:CONFIG += debug
-
TARGET = assert
diff --git a/tests/auto/selftests/assert/tst_assert.cpp b/tests/auto/selftests/assert/tst_assert.cpp
index 6e1fbdb509..bd44162971 100644
--- a/tests/auto/selftests/assert/tst_assert.cpp
+++ b/tests/auto/selftests/assert/tst_assert.cpp
@@ -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>