summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2011-05-03 11:44:16 +1000
committerRohan McGovern <rohan.mcgovern@nokia.com>2011-05-18 10:46:42 +1000
commit4bf7ac3968ea6d3aa3f438fe0bd2a53ac7e357b7 (patch)
tree0eb52b1b056ba71451e715ca3484630b905bce24
parente415182a1428bd265f13547058e07d1694955ae9 (diff)
Remove Q_ASSERT from QMetaObject autotest.
Issue a helpful warning rather than ignoring the error in release mode builds. Change-Id: Iea7bf4d63f8227abaf7dcf1700c5fef62763afad Task-number: QTBUG-17582 Reviewed-by: Rohan McGovern (cherry picked from commit 6f082a3fdd368cd7a969b7f324354583d081da82)
-rw-r--r--tests/auto/qmetaobject/tst_qmetaobject.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/tests/auto/qmetaobject/tst_qmetaobject.cpp b/tests/auto/qmetaobject/tst_qmetaobject.cpp
index 13e3bcd588..f1a909a941 100644
--- a/tests/auto/qmetaobject/tst_qmetaobject.cpp
+++ b/tests/auto/qmetaobject/tst_qmetaobject.cpp
@@ -244,7 +244,12 @@ public:
QObject *child;
public slots:
- void on_child1_destroyed(QObject *obj = 0) { ++invokeCount1; Q_ASSERT(obj && obj == child); }
+ void on_child1_destroyed(QObject *obj = 0)
+ {
+ ++invokeCount1;
+ if (!obj || obj != child)
+ qWarning() << "on_child1_destroyed invoked with wrong child object";
+ }
void on_child2_destroyed() { ++invokeCount2; }
};
@@ -268,7 +273,12 @@ public:
}
private slots:
- void on_child1_destroyed(QObject *obj) { ++invokeCount1; Q_ASSERT(obj && obj == child); }
+ void on_child1_destroyed(QObject *obj)
+ {
+ ++invokeCount1;
+ if (!obj || obj != child)
+ qWarning() << "on_child1_destroyed invoked with wrong child object";
+ }
void on_child1_destroyed() { ++invokeCount2; }
};