summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2011-05-09 03:01:40 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2011-05-09 08:27:02 (GMT)
commit844906474dd6905d36003143a03a2fbccf0ad0dd (patch)
treea7dd8efdfb5bf5f8824d887242675a03df1e5add /tests/auto
parent136f39bbb63706819eb18d000f305edbe1cc6a81 (diff)
downloadQt-844906474dd6905d36003143a03a2fbccf0ad0dd.zip
Qt-844906474dd6905d36003143a03a2fbccf0ad0dd.tar.gz
Qt-844906474dd6905d36003143a03a2fbccf0ad0dd.tar.bz2
Remove Q_ASSERT's from QObject autotest
Rather than aborting in debug builds and failing silently in release builds, report a meaningful fatal error in all builds. Change-Id: I3b874f187d482e9785a839cab1a3855b631404c3 Task-number: QTBUG-17582 Reviewed-by: Rohan McGovern
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qobject/signalbug.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/auto/qobject/signalbug.cpp b/tests/auto/qobject/signalbug.cpp
index f9c9650..55ef5b3 100644
--- a/tests/auto/qobject/signalbug.cpp
+++ b/tests/auto/qobject/signalbug.cpp
@@ -69,7 +69,8 @@ void Receiver::received ()
::Step++;
const int stepCopy = ::Step;
TRACE (stepCopy, "Receiver::received()");
- Q_ASSERT (::Step == 2 || ::Step == 4);
+ if (::Step != 2 && ::Step != 4)
+ qFatal("%s: Incorrect Step: %d (should be 2 or 4)", Q_FUNC_INFO, ::Step);
if (::Step == 2)
s->fire ();
@@ -91,7 +92,8 @@ void Disconnector::received ()
::Step++;
const int stepCopy = ::Step;
TRACE (stepCopy, "Disconnector::received()");
- Q_ASSERT (::Step == 5 || ::Step == 6);
+ if (::Step != 5 && ::Step != 6)
+ qFatal("%s: Incorrect Step: %d (should be 5 or 6)", Q_FUNC_INFO, ::Step);
fprintf (stderr, "Disconnector<%s>::received() sender=%s\n",
(const char *) objectName ().toAscii (), sender ()->metaObject()->className());
@@ -124,7 +126,8 @@ void Sender::fire ()
::Step++;
const int stepCopy = ::Step;
TRACE (stepCopy, "Sender::fire()");
- Q_ASSERT (::Step == 1 || ::Step == 3);
+ if (::Step != 1 && ::Step != 3)
+ qFatal("%s: Incorrect Step: %d (should be 1 or 3)", Q_FUNC_INFO, ::Step);
emit fired ();
TRACE (stepCopy, "ends Sender::fire()");