summaryrefslogtreecommitdiff
path: root/tests/auto/qmetaobject/tst_qmetaobject.cpp
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2011-05-03 11:44:16 +1000
committerJason McDonald <jason.mcdonald@nokia.com>2011-05-04 13:25:44 +1000
commit6f082a3fdd368cd7a969b7f324354583d081da82 (patch)
tree557305cfbe432cdc7fcc2c16c99e6885b75c4148 /tests/auto/qmetaobject/tst_qmetaobject.cpp
parent291f04a4a7be4a975c6b8eaeeed4e0c196e23128 (diff)
downloadqt4-tools-6f082a3fdd368cd7a969b7f324354583d081da82.tar.gz
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
Diffstat (limited to 'tests/auto/qmetaobject/tst_qmetaobject.cpp')
-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 d496c565ab..5621c4732b 100644
--- a/tests/auto/qmetaobject/tst_qmetaobject.cpp
+++ b/tests/auto/qmetaobject/tst_qmetaobject.cpp
@@ -241,7 +241,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; }
};
@@ -265,7 +270,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; }
};