diff options
author | Rohan McGovern <rohan.mcgovern@nokia.com> | 2012-02-09 13:48:02 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-09 08:22:34 +0100 |
commit | c8c1e22c0ba562de2d9a150fd5255b9d020848f2 (patch) | |
tree | a9084b2dcc93b7a31fc0b257174a04c5d08e36ff | |
parent | 62b027bc2f7b57fd773611e148d8730e8aa7e41b (diff) | |
download | qtscript-c8c1e22c0ba562de2d9a150fd5255b9d020848f2.tar.gz |
Fixed tst_QScriptValue::toQObject for new QVariant cast behavior
ae85d7c965e7d50404c056a77c73bfe00267fa12 in qtbase allows QObject
derived types to be extracted from a QVariant by value<QObject*>(),
which was previously not possible. The change also applies to
qscriptvalue_cast, so update this test for the new expected behavior.
Note that the behavior of QScriptValue::toQObject has not been updated,
which means the result of v.toQObject() vs
qscriptvalue_cast<QObject*>(v) on the same QScriptValue may now give
different results.
Change-Id: I70007002dc89d094d76754e58cc9042b4b4f0f67
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
-rw-r--r-- | tests/auto/qscriptvalue/tst_qscriptvalue.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp index ceafa00..9048a02 100644 --- a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp +++ b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp @@ -1417,8 +1417,8 @@ void tst_QScriptValue::toQObject() QScriptValue variant3 = eng.newVariant(qVariantFromValue(&button)); QCOMPARE(variant3.toQObject(), (QObject*)0); - QCOMPARE(qscriptvalue_cast<QObject*>(variant3), (QObject*)0); - QCOMPARE(qscriptvalue_cast<QWidget*>(variant3), (QWidget*)0); + QCOMPARE(qscriptvalue_cast<QObject*>(variant3), (QObject*)&button); + QCOMPARE(qscriptvalue_cast<QWidget*>(variant3), (QWidget*)&button); QCOMPARE(qscriptvalue_cast<QPushButton*>(variant3), &button); } |