summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2023-03-03 08:17:27 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-03-04 18:03:50 +0000
commit21615e8df1340f090a28d7bb6e6a18ff300a22e6 (patch)
treebea9f7f7225909299fac695aacbb053a96f4a3ac /tests/auto/corelib
parent39c201362fe6b67f90d091af14d98baf5a0bb1ef (diff)
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 df0085d3a28005e84eb7688cc2575a121ba322aa. 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> (cherry picked from commit fd17eaca8396288f34e89f5f66d2779c42ffc414) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests/auto/corelib')
-rw-r--r--tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp b/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp
index 9fe7115d63..f7f77fb313 100644
--- a/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp
+++ b/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp
@@ -5196,7 +5196,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);