From c8c1e22c0ba562de2d9a150fd5255b9d020848f2 Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Thu, 9 Feb 2012 13:48:02 +1000 Subject: Fixed tst_QScriptValue::toQObject for new QVariant cast behavior ae85d7c965e7d50404c056a77c73bfe00267fa12 in qtbase allows QObject derived types to be extracted from a QVariant by value(), 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(v) on the same QScriptValue may now give different results. Change-Id: I70007002dc89d094d76754e58cc9042b4b4f0f67 Reviewed-by: Kent Hansen --- tests/auto/qscriptvalue/tst_qscriptvalue.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') 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(variant3), (QObject*)0); - QCOMPARE(qscriptvalue_cast(variant3), (QWidget*)0); + QCOMPARE(qscriptvalue_cast(variant3), (QObject*)&button); + QCOMPARE(qscriptvalue_cast(variant3), (QWidget*)&button); QCOMPARE(qscriptvalue_cast(variant3), &button); } -- cgit v1.2.1