tst_QVariant: check fromValue() with a non-default-constructible type
... by just using fromValue() instead of the QVariant(QMetaType,
void*) ctor.
Code coverage isn't reduced, because fromValue() will, of course, call
that exact ctor itself.
Amends df0085d3a2.
Pick-to: 6.5 6.4 6.2
Task-number: QTBUG-105140
Task-number: QTBUG-111598
Change-Id: I02464803090fa7078947625616e6fc20e623ef31
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
bb10
parent
cbb484b713
commit
fd17eaca83
|
|
@ -5602,7 +5602,7 @@ void tst_QVariant::constructFromIncompatibleMetaType()
|
|||
void tst_QVariant::copyNonDefaultConstructible()
|
||||
{
|
||||
NonDefaultConstructible ndc(42);
|
||||
QVariant var(QMetaType::fromType<NonDefaultConstructible>(), &ndc);
|
||||
QVariant var = QVariant::fromValue(ndc);
|
||||
QVERIFY(var.isDetached());
|
||||
QCOMPARE(var.metaType(), QMetaType::fromType<NonDefaultConstructible>());
|
||||
QVERIFY(var.constData() != &ndc);
|
||||
|
|
|
|||
Loading…
Reference in New Issue