Use a large core type for the QVariant::setValue test.
authorStephen Kelly <stephen.kelly@kdab.com>
Tue, 24 Jul 2012 10:01:13 +0000 (12:01 +0200)
committerQt by Nokia <qt-info@nokia.com>
Tue, 24 Jul 2012 22:48:24 +0000 (00:48 +0200)
The type needs to be large enough that
QVariantIntegrator<T>::CanUseInternalSpace is true.

Change-Id: I311c44bedfebd946e41639975df206c27b6d55ca
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp

index 3a0b936..d8c6e25 100644 (file)
@@ -64,6 +64,8 @@
 #include <qvector4d.h>
 #include <qquaternion.h>
 #include <qdebug.h>
+#include <qjsondocument.h>
+
 
 #include <limits.h>
 
@@ -2990,8 +2992,8 @@ void tst_QVariant::toIntFromDouble() const
 
 void tst_QVariant::setValue()
 {
-    QTransform t; //we just take a value so that we're sure that it will be shared
-    QVariant v1 = t;
+    QJsonDocument t; //we just take a value so that we're sure that it will be shared
+    QVariant v1 = QVariant::fromValue(t);
     QVERIFY( v1.isDetached() );
     QVariant v2 = v1;
     QVERIFY( !v1.isDetached() );