summaryrefslogtreecommitdiff
path: root/tests/auto/qscriptvalue
diff options
context:
space:
mode:
authorStephen Kelly <stephen.kelly@kdab.com>2012-03-06 11:13:09 +0100
committerQt by Nokia <qt-info@nokia.com>2012-03-06 15:47:50 +0100
commit5b08ade72f12039aa5543106137d0cb937f3d7fa (patch)
treef3d0f4e8a1e02f08dbcefb9f9c37443c50972dc2 /tests/auto/qscriptvalue
parent88948c73595eb2d142b163edb6d791fed8298676 (diff)
downloadqtscript-5b08ade72f12039aa5543106137d0cb937f3d7fa.tar.gz
Make QScriptValue QObject handling consistent.
The behaviour has been inconsistent since ae85d7c965e7d50404c056a77c73bfe00267fa12 in qtbase which added special handling of QObjects to QVariant. Change-Id: Ie75faa3cc3387cff8894cdba025c93f2cc2ea491 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Diffstat (limited to 'tests/auto/qscriptvalue')
-rw-r--r--tests/auto/qscriptvalue/tst_qscriptvalue.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp
index 9048a02..5417cc1 100644
--- a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp
+++ b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp
@@ -1416,7 +1416,8 @@ void tst_QScriptValue::toQObject()
QCOMPARE(qscriptvalue_cast<QPushButton*>(variant2), &button);
QScriptValue variant3 = eng.newVariant(qVariantFromValue(&button));
- QCOMPARE(variant3.toQObject(), (QObject*)0);
+ QVERIFY(variant3.isQObject());
+ QCOMPARE(variant3.toQObject(), (QObject*)&button);
QCOMPARE(qscriptvalue_cast<QObject*>(variant3), (QObject*)&button);
QCOMPARE(qscriptvalue_cast<QWidget*>(variant3), (QWidget*)&button);
QCOMPARE(qscriptvalue_cast<QPushButton*>(variant3), &button);